Kafka vs RabbitMQ vs ZeroMQ vs RocketMQ vs ActiveMQ: Comprehensive Feature Comparison
This article systematically compares Kafka, RabbitMQ, ZeroMQ, RocketMQ, and ActiveMQ across documentation availability, supported programming languages, protocols, storage models, transaction capabilities, load‑balancing mechanisms, clustering approaches, management interfaces, availability, duplicate handling, throughput, subscription patterns, ordering guarantees, acknowledgment strategies, replay options, retry mechanisms, and concurrency limits, helping engineers choose the right message queue for their needs.
This article provides a comprehensive comparison of five popular message‑queue systems—Kafka, RabbitMQ, ZeroMQ, RocketMQ, and ActiveMQ—covering multiple technical dimensions.
1. Documentation
Kafka: Limited official docs, some books by the author, additional online resources.
RabbitMQ: Abundant documentation, several good books, many online resources.
ZeroMQ: Sparse documentation, no dedicated books; most information is code examples and brief introductions.
RocketMQ: Limited documentation; official docs are concise and lack deep technical details.
ActiveMQ: Plenty of online material, but no dedicated books.
2. Supported Languages
Kafka: Scala.
RabbitMQ: Erlang.
ZeroMQ: C.
RocketMQ: Java.
ActiveMQ: Java.
3. Protocols
Kafka: Proprietary TCP‑based protocol.
RabbitMQ: AMQP.
ZeroMQ: TCP/UDP.
RocketMQ: Proprietary protocol.
ActiveMQ: OpenWire, STOMP, REST, XMPP, AMQP.
4. Message Storage
Kafka stores messages in memory, disk, and databases; supports massive accumulation. It uses partitions (multiple per topic) distributed across brokers, with leaders and replicas for load balancing and high availability.
RabbitMQ stores messages in memory and disk; supports limited accumulation. It distinguishes persistent and non‑persistent messages, with optional mirroring for high availability.
ZeroMQ does not provide persistence; messages reside in sender memory or disk and are not durable.
RocketMQ stores messages on disk using a commit‑log (1 GB per file) and a lightweight ConsumeQueue index; supports large accumulation and high write throughput.
ActiveMQ stores messages in memory, disk, and databases; supports limited accumulation.
5. Transaction Support
Kafka: Supports transactions.
RabbitMQ: Supports transactions (client‑side channel set to transaction mode; commit succeeds only after broker acknowledges).
ZeroMQ: No transaction support.
RocketMQ: Supports transactions.
ActiveMQ: Supports transactions.
6. Load Balancing
Kafka: Built‑in load balancing via partition leaders and consumer group rebalancing; automatic distribution of partitions across brokers.
RabbitMQ: Limited load‑balancing; routing determined by exchanges, keys, and manual queue declarations. Supports round‑robin dispatch to consumers and can use external load balancers (HAProxy, LVS) or client‑side algorithms.
ZeroMQ: Decentralized, does not provide load balancing.
RocketMQ: Supports load balancing; consumer count must not exceed queue count, and consumers are evenly assigned to queues.
ActiveMQ: Supports load balancing, can be integrated with ZooKeeper.
7. Clustering
Kafka: Leader‑Slave, stateless cluster; each broker can act as both leader and follower; relies on ZooKeeper for dynamic membership.
RabbitMQ: Simple clustering with replication; each node can be memory‑ or disk‑based; queues are created on a single node, with optional mirroring for high availability.
ZeroMQ: No clustering support.
RocketMQ: Master‑Slave model; NameServer is stateless and can be clustered; brokers have master and slave roles with data replication.
ActiveMQ: Simple master‑slave clustering; advanced clustering features are limited.
8. Management UI
Kafka: Generally no built‑in UI.
RabbitMQ: Provides a decent management console.
ZeroMQ: No UI.
RocketMQ: No UI.
ActiveMQ: Provides a basic UI.
9. Availability
Kafka: Very high (distributed).
RabbitMQ: High (master‑slave).
ZeroMQ: High.
RocketMQ: Very high (distributed).
ActiveMQ: High (master‑slave).
10. Duplicate Handling
Kafka & RabbitMQ: Support at‑least‑once and at‑most‑once delivery.
ZeroMQ: No persistence; does not guarantee at‑least‑once or at‑most‑once.
RocketMQ & ActiveMQ: Support at‑least‑once delivery.
11. Throughput (TPS)
Kafka: Extremely high, uses batch sending and consumption.
RabbitMQ: Relatively high.
ZeroMQ: Extremely high.
RocketMQ: High; can batch consume but not batch send.
ActiveMQ: Relatively high.
12. Subscription & Message Distribution
Kafka: Topic‑based publish/subscribe with optional regex matching; consumer groups ensure each partition is consumed by a single consumer within the group.
RabbitMQ: Supports direct, topic, headers, and fanout exchanges; queues are basic storage units; messages are routed based on exchange and routing key.
ZeroMQ: Point‑to‑point (p2p) model.
RocketMQ: Topic/messageTag based publish/subscribe with regex matching; supports both broadcast and cluster consumption.
ActiveMQ: Supports both point‑to‑point and publish/subscribe modes.
13. Ordered Messages
Kafka: Supports ordering within a partition (key‑based or null key).
RabbitMQ, ZeroMQ, ActiveMQ: Do not support ordered delivery.
RocketMQ: Supports ordered messages.
14. Acknowledgment
Kafka: Supports various ack levels (0, 1, all) and manual offset commits.
RabbitMQ: Supports publisher confirms and consumer acknowledgments (auto or manual).
ZeroMQ, RocketMQ, ActiveMQ: Support acknowledgments.
15. Message Replay
Kafka: Can replay from a specific offset.
RabbitMQ & ActiveMQ: Do not support replay.
RocketMQ: Can replay to a specific timestamp.
16. Retry Mechanisms
Kafka: No built‑in retry, but can be implemented via offset replay.
RabbitMQ: No built‑in retry, but can be achieved using acknowledgment and dead‑letter queues.
ZeroMQ: No retry support.
RocketMQ: Built‑in retry with configurable intervals.
ActiveMQ: No retry support.
17. Concurrency
Kafka: High concurrency; each consumer runs in its own thread; consumer count limited by partition count.
RabbitMQ: Very high concurrency; each channel can be bound to a thread; supports basicQos to limit unacknowledged messages per consumer.
ZeroMQ: High concurrency.
RocketMQ: High concurrency; similar consumer‑count limits as Kafka.
ActiveMQ: High concurrency; single broker can handle tens of thousands of messages per second.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
