Backend Development 24 min read

Comprehensive Comparison of Kafka, RabbitMQ, ZeroMQ, RocketMQ, and ActiveMQ

This article provides a detailed side‑by‑side comparison of five popular message‑queue systems—Kafka, RabbitMQ, ZeroMQ, RocketMQ, and ActiveMQ—covering documentation, programming languages, supported protocols, storage, transactions, load balancing, clustering, management UI, availability, duplication handling, throughput, subscription models, ordering, acknowledgments, replay, retry, concurrency, and includes promotional information from the author.

Code Ape Tech Column
Code Ape Tech Column
Code Ape Tech Column
Comprehensive Comparison of Kafka, RabbitMQ, ZeroMQ, RocketMQ, and ActiveMQ

1. Documentation

Kafka: Official book by the author and some online resources.

RabbitMQ: Plenty of books and abundant online material.

ZeroMQ: Few resources; mainly code examples and brief introductions.

RocketMQ: Few resources; official docs are concise but lack technical depth.

ActiveMQ: Many books and abundant online material.

2. Development Language

Kafka: Scala

RabbitMQ: Erlang

ZeroMQ: C

RocketMQ: Java

ActiveMQ: Java

3. Supported Protocols

Kafka: Proprietary protocol based on TCP.

RabbitMQ: AMQP

ZeroMQ: TCP, UDP

RocketMQ: Proprietary protocol.

ActiveMQ: OpenWire, STOMP, REST, XMPP, AMQP

4. Message Storage

Kafka: Memory, disk, database; supports large accumulation. The smallest storage unit is a partition; partitions are distributed across brokers for load balancing and high availability.

RabbitMQ: Memory and disk; supports limited accumulation. Persistent messages are written to disk and optionally kept in memory; non‑persistent messages reside in memory and may be swapped to disk under pressure.

ZeroMQ: Stored in sender’s memory or disk; does not support persistence.

RocketMQ: Disk; supports large accumulation. Uses CommitLog for message data and ConsumeQueue as an index.

ActiveMQ: Memory, disk, database; supports limited accumulation.

5. Message Transactions

Kafka: Supported.

RabbitMQ: Supported (client sets channel to transaction mode; performance may degrade).

ZeroMQ: Not supported.

RocketMQ: Supported.

ActiveMQ: Supported.

6. Load Balancing

Kafka: Supports load balancing via partition distribution, consumer groups, and automatic rebalancing.

RabbitMQ: Poor native load balancing; relies on exchanges, routing keys, and optional HAProxy/LVS or client‑side algorithms (round‑robin, weighted, random, hash, least connections).

ZeroMQ: Decentralized; does not support load balancing.

RocketMQ: Supports load balancing; consumer count should not exceed queue count.

ActiveMQ: Supports load balancing, can be implemented with ZooKeeper.

7. Clustering Model

Kafka: Leader‑Slave stateless cluster; each broker can be both leader and replica; relies on ZooKeeper for dynamic scaling.

RabbitMQ: Simple clustering with replication; at least one disk node required; queues are created on a single node, but mirrored queues improve availability.

ZeroMQ: Decentralized; no clustering support.

RocketMQ: Master‑Slave mode; NameServer is stateless; brokers register with NameServer; producers and consumers discover brokers via NameServer.

ActiveMQ: Simple master‑slave clustering; advanced clustering not well supported.

8. Management UI

Kafka: Basic.

RabbitMQ: Good.

ZeroMQ: None.

RocketMQ: None.

ActiveMQ: Basic.

9. Availability

Kafka: Very high (distributed).

RabbitMQ: High (master‑slave).

ZeroMQ: High.

RocketMQ: Very high (distributed).

ActiveMQ: High (master‑slave).

10. Message Duplication

Kafka: Supports at‑least‑once and at‑most‑once.

RabbitMQ: Supports at‑least‑once and at‑most‑once.

ZeroMQ: Only retransmission; no persistence; does not fit standard delivery guarantees.

RocketMQ: Supports at‑least‑once.

ActiveMQ: Supports at‑least‑once.

11. Throughput (TPS)

Kafka: Very high; batch send/consume.

RabbitMQ: Relatively high.

ZeroMQ: Very high.

RocketMQ: High.

ActiveMQ: Relatively high.

12. Subscription Model and 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: Four exchange types: direct, topic, headers, fanout; queues are basic storage units; routing key and exchange determine delivery.

ZeroMQ: Point‑to‑point (p2p).

RocketMQ: Topic/messageTag based publish/subscribe; supports broadcasting and clustered consumption.

ActiveMQ: Supports both point‑to‑point and publish/subscribe.

13. Ordered Messages

Kafka: Supported; ordering guaranteed per partition.

RabbitMQ: Not supported.

ZeroMQ: Not supported.

RocketMQ: Supported.

ActiveMQ: Not supported.

14. Message Acknowledgment

Kafka: Supports acknowledgments (acks=0,1,all) and offset commits.

RabbitMQ: Supports publisher confirms and consumer acknowledgments (autoAck true/false).

ZeroMQ: Supported.

RocketMQ: Supported.

ActiveMQ: Supported.

15. Message Replay

Kafka: Supports offset‑based replay.

RabbitMQ: Not supported.

ZeroMQ: Not supported.

RocketMQ: Supports time‑point based replay.

ActiveMQ: Not supported.

16. Message Retry

Kafka: Not built‑in but can be achieved via offset replay.

RabbitMQ: Not built‑in but can be implemented using manual acknowledgments.

ZeroMQ: Not supported.

RocketMQ: Supported; retries are scheduled with fixed intervals.

ActiveMQ: Not supported.

17. Concurrency

Kafka: High; one thread per consumer; consumer count ≤ partition count.

RabbitMQ: Very high; Erlang‑based, multiple channels per connection, thread‑per‑channel model.

ZeroMQ: High.

RocketMQ: High; consumer count ≤ queue count; can increase threads via consumeThreadMin/Max.

ActiveMQ: High; single broker can handle tens of thousands of messages per second.

Final Note (Please Follow)

The author asks readers to like, view, share, and bookmark the article if it helped them, emphasizing that such support motivates continued content creation.

Additional promotional information about the author's knowledge community, subscription fees, and related technical series is included.

KafkaMessage QueueRabbitMQrocketmqcomparisonActiveMQZeroMQ
Code Ape Tech Column
Written by

Code Ape Tech Column

Former Ant Group P8 engineer, pure technologist, sharing full‑stack Java, job interview and career advice through a column. Site: java-family.cn

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.