Kafka message queue backend implementation for the Abstract Backend ecosystem. Provides an async-friendly Kafka client with simple, environment-driven configuration and JSON message handling.
- Environment-first config via
KAFKA_*variables - Auth modes: PLAINTEXT, SASL/PLAIN, SSL
- Async publish/consume with JSON serialization
- Drop-in backend selected by
MESSAGE_QUEUE_BACKEND=kafka
Supports Python 3.12 and 3.13.
Install and run a minimal round-trip locally.
# Install (choose one)
pip install abe-kafka
# or
uv add abe-kafka
# Minimal environment
export MESSAGE_QUEUE_BACKEND=kafka
export KAFKA_BOOTSTRAP_SERVERS=localhost:9092import asyncio
from abe_plugin.backends.message_queue.service.abe_kafka import KafkaMessageQueueBackend
async def main():
backend = KafkaMessageQueueBackend.from_env()
await backend.publish("demo-topic", {"hello": "world"})
async for msg in backend.consume(group="g1"):
print("received:", msg)
break
await backend.close()
asyncio.run(main())For SASL/SSL examples and starting a local Kafka (Docker Compose or Testcontainers), see the Installation and How to Run docs below.
- Quick Start: Installation
- Quick Start: How to Run
- Overview and configuration: Introduction
- API Reference: Kafka Backend
For contributor guides, see Development: index, workflow.
abe-kafka follows coding styles black and PyLint to control code quality.
Package download statistics: