
RabbitMQ vs Kafka at a glance
Choose RabbitMQ when you need content-based routing, request/reply or RPC-style messaging, per-message acknowledgement control, or a broker that speaks several open standard protocols, including AMQP 1.0 and MQTT 5.0, to a mix of services. Choose Kafka when you need to retain and replay a stream of events, feed several independent consumers from the same data, or build around a durable, ordered log for analytics, event sourcing, or integration pipelines. Many production systems run both, each handling the part it fits.
The RabbitMQ team's own comparison puts it this way: Kafka was once streaming only and RabbitMQ messaging and queueing only, but today both do both. The remaining hard difference is routing: Kafka still does not route on the broker.
| Criterion | RabbitMQ | Kafka |
|---|---|---|
| Core model | Messaging and streaming broker; exchanges route messages to queues | Partitioned log; events are not deleted after consumption |
| Ordering | FIFO within a queue under normal conditions | Guaranteed within a partition, not across a topic |
| Retention and replay | Queues are consumed and removed; streams provide a replicated, replayable log (since 2021) | Each topic keeps events for a configured period; consumers can re-read |
| Routing | Broker-side, through exchanges and bindings | No broker-side routing; topic and partition design plus client logic |
| Queue semantics | Acknowledgements, redelivery, dead-lettering, replication | Share groups (production-ready in 4.2): per-record acknowledgement and delivery counting |
| Licensing and support | Free under the Mozilla Public License 2.0; Broadcom offers commercial Tanzu RabbitMQ with 24/7 support | Apache Kafka, documented at kafka.apache.org |
| Current release line | RabbitMQ 4.4.1 | Kafka 4.4.x documentation |
Delivery and ordering guarantees
RabbitMQ delivers in FIFO order within a single queue under normal conditions. Consumer acknowledgements tell the broker when a message is safely processed, and unacknowledged messages are redelivered. Publisher confirms tell the producer the broker has accepted the message. The result is at-least-once delivery with well-understood failure handling, including dead-letter exchanges for messages that repeatedly fail.
Kafka guarantees order only within a partition. Partitions are the unit of parallelism, so there is no ordering across them by design. Consumers track their own position (the offset) rather than the broker tracking per-consumer delivery state. Kafka also offers idempotent producers and a transactional API for exactly-once writes within Kafka. If you need strict ordering for one entity, such as one customer or one order, give all its events the same key so they land in one partition.
# RabbitMQ: consumer acknowledges after processing
def on_message(ch, method, properties, body):
process(body)
ch.basic_ack(delivery_tag=method.delivery_tag)
# Kafka: consumer commits its own offset after processing
for msg in consumer:
process(msg.value)
consumer.commit(msg)
Retention and replay
Classic RabbitMQ queues are consumption-oriented: once a message is acknowledged, it is gone. That fits request/reply and job dispatch, where a message matters once and history is not needed. For workloads that need history, RabbitMQ streams provide a replicated, replayable log as a first-class destination type alongside queues, and have since 2021.
Kafka keeps events in a topic for a configured period, whether or not any consumer has read them. A new consumer group can start from the beginning and rebuild state, several teams can read the same topic independently, and a consumer can rewind its offset after a bug fix. This is why Kafka is a common choice for event sourcing and change data capture: the log is the source of truth, not just a transport.
The practical question is no longer whether a system can replay, but how your consumers get their own view of history. Both systems can serve it; they differ in how much the rest of your stack already assumes one model or the other.
Routing: exchanges vs topics and partitions
RabbitMQ routes inside the broker. A producer publishes to an exchange, and bindings decide which queues receive the message based on a routing key or headers. Direct, topic, fanout, and headers exchanges cover point-to-point, pattern-based, broadcast, and attribute-based routing without the producer knowing what sits downstream.
Kafka has no broker-side routing in that sense: what Kafka still does not do is route on the broker. A producer writes to a topic, and the partition is normally chosen by hashing a key, or by the client's default strategy when there is no key. Content-based dispatch, priority, and binding-style logic remain application work. Topic and partition design is effectively Kafka's routing layer, decided up front rather than configured as bindings.
# RabbitMQ: topic exchange routes by pattern
channel.exchange_declare(exchange='orders', exchange_type='topic')
channel.queue_bind(exchange='orders', queue='orders_eu', routing_key='orders.eu.*')
channel.basic_publish(exchange='orders', routing_key='orders.eu.de', body=payload)
# Kafka: key chooses the partition, not a destination queue
producer.produce(topic='orders', key='de', value=payload)
Consumer models and throughput trade-offs
RabbitMQ's classic pattern is competing consumers on a queue. The broker dispatches each message to one available consumer, and prefetch (QoS) settings control how many unacknowledged messages a consumer can hold. This suits variable, per-message work where you want control over fairness and backpressure.
Kafka uses consumer groups: each partition is read by one consumer in a group at a time, so parallelism within a group is capped by the partition count. Share groups, production-ready since Kafka 4.2, add a second model for records processed one at a time, with per-record acknowledgement and delivery counting. That narrows the gap with RabbitMQ work queues considerably.
In general terms, appending to and reading a sequential log is a simpler operation than per-message broker bookkeeping, so Kafka's design leans toward sustained high-volume streaming, while RabbitMQ's leans toward routing flexibility and per-message control. Actual throughput depends on message size, durability settings, and hardware, so measure with your own workload.
Day to day, watch consumer lag per partition in Kafka, and queue depth plus unacknowledged message counts in RabbitMQ. Both signal that consumers cannot keep up, though the metrics and alerting differ.
Operations: KRaft and quorum queues
Both systems replicate data across nodes. RabbitMQ nodes form a cluster and can replicate messages across it, and quorum queues add replicated, consensus-based queues. Use quorum queues for anything where losing messages during a failover is not acceptable, and check the current RabbitMQ documentation if you still rely on older queue types.
For Kafka, cluster metadata management (KRaft versus the older ZooKeeper-based mode) varies by release. Check the Apache Kafka documentation for your version, currently published as the 4.4.x series, to see which metadata mode it supports and what the upgrade path looks like.
Release lifecycle matters when you choose. RabbitMQ 4.4 (4.4.1 is the latest release) came out on 16 November 2026, with community support running until 31 July 2027. Plan upgrades around that window, or look at the commercial Tanzu RabbitMQ offering if you need 24/7 support.
Running both, migrating, and when to pick each
Running both is common. A frequent pattern is Kafka as the durable backbone for events from many systems, with RabbitMQ closer to application logic for task dispatch, RPC, or routing that depends on message content. Services can consume from Kafka and fan work out over RabbitMQ queues, or publish results back into a Kafka topic for downstream consumers.
Migrating is a redesign, not a drop-in swap. Moving RabbitMQ workloads to Kafka means replacing exchange and binding logic with topic and partition-key design, and taking on offset handling that RabbitMQ did for you. Moving Kafka workloads to RabbitMQ means moving from topics to streams (or to queues that are emptied once consumed), and rethinking how independent consumers get their own view of history.
- Pick RabbitMQ for task queues, RPC and request/reply, and routing that depends on message content.
- Pick Kafka for event streaming, event sourcing, change data capture, and any case where several consumers need independent access to history.
- Pick both when you have a clear event backbone and a clear task-distribution layer that benefit from different guarantees.
Common questions
Can Kafka replace RabbitMQ as a task queue?
It can, and the gap has narrowed: Kafka 4.2 made share groups production-ready, adding per-record acknowledgement and delivery counting for records processed one at a time. What Kafka still does not do is route on the broker, so content-based dispatch, priority and binding logic remain application work.
Does RabbitMQ support replaying old messages like Kafka?
Yes, through streams. Classic queues are consumption-oriented, but RabbitMQ streams have provided a replicated, replayable log since 2021, as a first-class destination type alongside queues.
Are quorum queues required in RabbitMQ?
No, but they are the recommended choice when losing messages during a failover is not acceptable. They provide replicated, consensus-based queues. Check the current documentation if you still rely on older queue types.
Can I use RabbitMQ and Kafka together?
Yes, and many systems do. Kafka often serves as the event backbone with retained history, while RabbitMQ handles task dispatch and content-based routing close to the application. Services can consume from one and publish into the other.
Sources
About this page
Last reviewed November 28, 2026 by the Nine Bits editors. Read our editorial policy or report an error.