Independent ActiveMQ handbook · archive of the 2004–2007 project site
Independent guide. Not the Apache ActiveMQ project site and not affiliated with the Apache Software Foundation. ActiveMQ and Apache are trademarks of the ASF. Official documentation: activemq.apache.org.

activemq.org › Handbook › RabbitMQ vs Kafka: how they differ and which to use

Handbook

RabbitMQ vs Kafka: how they differ and which to use

Checked against ActiveMQ Classic 6.4.0, 6.3.3 and 5.19.12 and Apache Artemis 2.57.0 on . Independent guide; sources are listed at the end. Official documentation: activemq.apache.org and artemis.apache.org.

RabbitMQ is a message broker: publishers send messages to exchanges, the broker routes each one into queues and pushes it to consumers, and a queued message is deleted once a consumer has finished with it. Apache Kafka is an event streaming platform: producers append records to partitioned, replicated topics, consumers pull them by offset, and records stay on disk for the topic's retention period whether or not anyone has read them.

The two have grown toward each other. RabbitMQ added streams, an append-only replicated log, in 3.9 (2021), and Kafka 4.2 made share groups, its queue-style way of consuming, production-ready. This page compares RabbitMQ 4.4 (latest patch 4.4.1, 16 November 2026) with Apache Kafka 4.4 (4.4.0, released 22 October 2026), using each project's own documentation.

RabbitMQ vs Kafka at a glance

RabbitMQ 4.4Apache Kafka 4.4
What the project calls itselfA message broker that accepts and forwards messagesAn event streaming platform
Core data structureExchanges and bindings that route into queues (classic or quorum) or streamsTopics split into partitions; each partition is an ordered log
How consumers get messagesThe broker pushes deliveries to subscribed consumersConsumers pull from brokers, with long polling
After a message is processedQueues: deleted. Streams: kept until retention removes itKept until the topic's retention setting (or compaction) removes it
ReplayStreams only: start from any point in the logRewind the consumer offset and read again
OrderingFIFO per queuePer partition; records with the same key go to the same partition
RoutingIn the broker: direct, topic, fanout and headers exchanges, plus plugin typesIn the producer: the client chooses the partition, at random or by key
ProtocolsAMQP 1.0, AMQP 0-9-1, MQTT 3.1/3.1.1/5.0, STOMP, RabbitMQ StreamsKafka's own binary protocol over TCP
ReplicationQuorum queues (Raft) and streams; classic queues are not replicatedEvery partition, with a replication factor set per topic
Built-in managementManagement plugin: web UI, HTTP API and rabbitmqadminCommand-line tools and the Admin API; metrics over JMX
RuntimeErlang/OTPJava (17, 21 and 25 fully supported)
LicenseMozilla Public License 2.0Apache License 2.0

How RabbitMQ handles a message

A RabbitMQ publisher never writes to a queue directly. It sends to an exchange, and the exchange type decides where the message goes: a fanout exchange copies every message to every queue or stream bound to it, a direct exchange matches the routing key exactly, and a topic exchange matches routing-key patterns. Headers exchanges and several plugin-provided types are also available. Bindings, the rules that connect an exchange to queues, streams or other exchanges, can be changed by clients at runtime.

Behind the exchange you choose a queue type, and in RabbitMQ 4.x these are different data structures:

  • Classic queues are the default type unless the virtual host overrides it. Since RabbitMQ 4.0 they are not replicated; the old classic mirrored queues were removed in 4.0.
  • Quorum queues are durable, replicated queues built on the Raft consensus algorithm. The RabbitMQ documentation calls them the default choice when you need a replicated, highly available queue.
  • Streams are an append-only log that consumers can read repeatedly until the data expires. They are always persistent and replicated.

Consumers subscribe to a queue and RabbitMQ pushes deliveries to them. The consumer acknowledges each delivery, and the publisher can ask for publisher confirms so it knows the broker has taken responsibility for a message.

How Kafka handles a message

Kafka stores events in topics, and each topic is spread over partitions on different brokers. A producer sends each record straight to the broker that leads the target partition; records with the same key always land in the same partition. Each record gets an offset, a position in that partition's log.

Consumers read in consumer groups. Within a group, each partition is read by exactly one consumer at a time, so the group's progress is just one offset per partition. Because consuming does not delete anything, a consumer can rewind its offset and process old records again, and several groups can read the same topic independently. How long records stay is a per-topic setting; log compaction is the alternative policy that keeps at least the last record for each key.

Kafka also includes two layers on top of the log: Kafka Connect, for import and export connectors to other systems, and the Kafka Streams API for Java and Scala, for stream processing with aggregations, joins and windowing.

Push vs pull: how messages reach consumers

RabbitMQ uses push delivery. Once a consumer is registered, the broker sends it messages, and a bounded prefetch on the channel limits how many unacknowledged deliveries a consumer can hold at once.

Kafka uses pull. The producer pushes data to the broker, and the consumer fetches from the broker starting at an offset it chooses. To avoid busy-waiting on an empty partition, a fetch request can block in a long poll until data arrives. Kafka's design documentation explains the reasoning: with pull, a slow consumer simply falls behind and catches up later, and each fetch can return a large batch.

Retention and replay

This is the biggest practical difference. RabbitMQ's queue types are destructive: a message is deleted once a consumer is finished with it, and it cannot be read again. If you need replay in RabbitMQ, you use a stream. A stream consumer can attach at the first available message, the last written chunk, the next new message, an exact offset or a timestamp, and retention is set per stream by total size, age or both.

In Kafka every topic behaves like that. Events are not deleted when they are consumed; old data is discarded after a set time or once the log reaches a set size. Re-processing records after fixing a consumer bug, or starting a new consumer group from the beginning, needs no special setup.

Message ordering

A RabbitMQ queue is an ordered, first-in-first-out collection. Messages published on a single channel are enqueued in publishing order in every queue they are routed to. The documentation lists what can change the effective delivery order: message priorities, redelivery when several consumers share a queue, and publishing across multiple channels. For ordered processing with parallelism, RabbitMQ offers single active consumer and super streams (partitioned streams, available since 3.11).

Kafka guarantees order within a partition: any consumer of a partition reads its records in exactly the order they were written. Choosing a key, such as a customer ID, is how you keep related records in order while spreading load across partitions.

Routing and filtering

RabbitMQ routes in the broker. Exchange types and exchange-to-exchange bindings let you change who receives what without changing producers, and a message that is rejected, expires or exceeds a limit can be dead-lettered, which means it is republished to another exchange.

Kafka routes in the client. The producer decides the partition, at random or by key, and consumers subscribe to whole topics. Anything more selective happens in the consuming application or in a stream-processing job that writes a filtered topic.

Protocols and client libraries

RabbitMQ is multi-protocol. It was originally built for AMQP 0-9-1, and AMQP 1.0 became a core protocol in RabbitMQ 4.0; the RabbitMQ team now recommends AMQP 1.0 for new applications. MQTT 3.1, 3.1.1 and 5.0 and the RabbitMQ Streams protocol are supported natively through plugins, STOMP through a plugin, and AMQP 1.0, MQTT and STOMP can all run over WebSocket. The RabbitMQ team maintains AMQP 1.0 clients for Java, .NET, Go, Python and JavaScript.

Kafka speaks one protocol: its own binary request/response protocol over TCP. Kafka ships with some clients, including its Java and Scala APIs, and dozens more come from the Kafka community, covering Go, Python, C/C++ and many other languages as well as REST APIs. To compare the AMQP versions, see AMQP 0-9-1 vs 1.0; for STOMP, see the STOMP protocol guide.

Replication and high availability

A RabbitMQ cluster is a group of nodes that share users, virtual hosts, queues, streams, exchanges and bindings. Data replication is a property of the queue type: quorum queues replicate through Raft, streams are always replicated, and classic queues are not replicated at all in 4.x.

Kafka replicates every partition across a configurable number of brokers, set per topic, so a replica can take over if a broker fails; the introduction notes that a replication factor of 3 is a common production setting. Cluster metadata is managed by Kafka's built-in KRaft controllers: Kafka 4.0 removed ZooKeeper mode, and clusters still on ZooKeeper must migrate through the 3.9 bridge release.

Queues in Kafka, logs in RabbitMQ

Kafka's share groups (KIP-932, "Queues for Kafka") became production-ready in Kafka 4.2. Consumers in a share group cooperate on the same partitions instead of owning them, so a group can have more consumers than the topic has partitions. Records are acknowledged one by one, delivery attempts are counted, and a fetched record is locked to one consumer for a time-limited period (30 seconds by default) before it becomes available again. A consumer can acknowledge, release, reject or renew each record it holds. Kafka's 4.4 upgrade notes add dead-letter queue support for share groups. The upgrade notes recommend share groups when records are processed one at a time rather than as an ordered stream.

From the other side, RabbitMQ streams and super streams give you an offset-based, replayable, partitioned log inside a broker that also runs ordinary queues.

RabbitMQ's documentation includes a detailed RabbitMQ vs Apache Kafka comparison written by the RabbitMQ team. Read it as a vendor's view; it is listed under Sources.

Management and monitoring

RabbitMQ's management plugin is included in the distribution and enabled with rabbitmq-plugins enable rabbitmq_management. It adds a browser UI (at http://localhost:15672/ on a local node), an HTTP API and rabbitmqadmin; for long-term metrics and alerting, the documentation recommends Prometheus. Kafka provides command-line tools and an Admin API, and its brokers and Java clients expose metrics through JMX.

Licensing and commercial offerings

RabbitMQ is free and open source under the Mozilla Public License 2.0; Broadcom offers a commercial edition with 24/7 support. Apache Kafka is licensed under the Apache License 2.0. The Kafka introduction notes that you can run it yourself or use fully managed services from a variety of vendors.

Where ActiveMQ fits

ActiveMQ Classic and Apache Artemis (formerly ActiveMQ Artemis) are message brokers in the same family as RabbitMQ: they hold messages in queues and topics, and each queued message goes to exactly one consumer. Their main difference from RabbitMQ is that both are Java brokers built around the JMS (Jakarta Messaging) API, and both also speak AMQP 1.0, STOMP and MQTT. Their official documentation is at activemq.apache.org and artemis.apache.org. For the details, see ActiveMQ vs RabbitMQ, ActiveMQ vs Kafka and ActiveMQ Classic vs Artemis.

Which one should you use?

Start from the shape of the work:

  • Distributing tasks to a pool of workers, with per-message acknowledgement, retries, dead-lettering, priorities or message TTL: this is what RabbitMQ queues are designed for, with quorum queues when the work must survive a node failure. If you already run Kafka, share groups (4.2 and later) now cover the basic work-queue pattern without adding a second system.
  • Routing decided at runtime, where consumers pick what they want by pattern or header: RabbitMQ's exchanges do this in the broker. In Kafka, consumers subscribe to whole topics, so you design the topic layout up front.
  • An event history that many teams read at their own pace, with replay and retention measured in days or more: Kafka's model is built around this. RabbitMQ streams cover similar ground if RabbitMQ is already your broker.
  • Stream processing and data integration: Kafka Streams and Kafka Connect are part of Apache Kafka.
  • Many protocols at the edge, such as IoT devices on MQTT, browsers on STOMP or AMQP over WebSocket, and AMQP 1.0 services: RabbitMQ handles these in one broker, while Kafka clients connect with the Kafka protocol.
  • Ordered processing per entity at scale: Kafka partitions keyed by entity, or RabbitMQ super streams with single active consumer.
  • License: if your organization treats MPL 2.0 and Apache 2.0 differently, check that before anything else.

Nothing stops you from running both, with a broker for commands and work queues and a log for events that other systems replay. If what you need is a JMS broker, read what a message broker is and the ActiveMQ comparisons linked above.

Frequently asked questions

What is the main difference between RabbitMQ and Kafka?

RabbitMQ is a message broker that routes messages through exchanges into queues, pushes them to consumers and deletes them once consumed. Kafka is an event streaming platform that appends records to a partitioned log, lets consumers pull them by offset and keeps them until the topic's retention period ends.

Does Kafka support queues now?

Yes. Share groups (KIP-932, Queues for Kafka) became production-ready in Kafka 4.2. Consumers in a share group can share partitions, acknowledge records individually and have delivery attempts counted, and Kafka 4.4's upgrade notes add dead-letter queue support for them.

Can RabbitMQ replay messages like Kafka?

Only from streams. RabbitMQ queue types delete a message once a consumer is finished with it, but a RabbitMQ stream is an append-only log that consumers can read from the start, an offset or a timestamp until retention removes the data.

Is RabbitMQ open source like Kafka?

Both are open source under different licenses. RabbitMQ is free under the Mozilla Public License 2.0, with a commercial edition from Broadcom, and Apache Kafka is licensed under the Apache License 2.0.

Which protocols do RabbitMQ and Kafka support?

RabbitMQ supports AMQP 1.0, AMQP 0-9-1, MQTT 3.1, 3.1.1 and 5.0, STOMP and its own streams protocol, with AMQP 1.0, MQTT and STOMP also available over WebSocket. Kafka uses its own binary protocol over TCP.

Related guides

Sources

  1. Apache Kafka: Introduction kafka.apache.org
  2. Apache Kafka 4.4: Design kafka.apache.org
  3. Apache Kafka 4.4: Upgrading (notable changes) kafka.apache.org
  4. RabbitMQ: Queues www.rabbitmq.com
  5. RabbitMQ: Streams and Super Streams www.rabbitmq.com
  6. RabbitMQ: Quorum Queues www.rabbitmq.com
  7. RabbitMQ: Which protocols does RabbitMQ support? www.rabbitmq.com
  8. RabbitMQ vs. Apache Kafka (by the RabbitMQ team) www.rabbitmq.com