rabbitkit¶
RabbitMQ-first production toolkit for Python — safe retries, dead-letter queues, explicit acknowledgement policies, topology validation, in-process testing, and Kubernetes-ready lifecycle management.
Quick Start¶
from rabbitkit import AsyncBroker, RabbitConfig
from rabbitkit.core.config import RetryConfig
broker = AsyncBroker(RabbitConfig())
@broker.subscriber(
queue="orders",
retry_config=RetryConfig(max_retries=3, delays=(5, 30, 120)),
)
async def handle(body: dict) -> None:
print(f"Order: {body}")
# Publish (simple kwargs form)
await broker.publish(routing_key="orders", body={"id": 1})
Documentation¶
- Getting Started — install, first consumer, publish, retry, test
- User Guide — 30 sections, beginner to advanced
- API Reference — every class, method, and config field
- Ack Policies — AUTO / MANUAL / NACK_ON_ERROR / ACK_FIRST
- Retry & DLQ — topology, retry count tracking, error classification
- Message Safety — guarantee: original never acked before retry confirmed
- Ordering Guarantees — when order is and isn't preserved
- Kubernetes — liveness/readiness probes, graceful shutdown, HPA
- Security — TLS, HMAC signing, decompression limits, credential hygiene
- Stability Policy — stable vs experimental API surface
- Comparison — vs FastStream, aio-pika, Celery
- Roadmap — what's shipped and what's planned
- CLI Reference —
topology validate/diff/apply,dlq inspect/replay,health,routes
Installation¶
pip install rabbitkit[async] # async transport (aio-pika)
pip install rabbitkit[sync] # sync transport (pika)
pip install rabbitkit[all] # everything