What RabbitMQ Does
- AMQP 0.9.1 — primary protocol, plus AMQP 1.0
- Exchanges — direct, fanout, topic, headers
- Queues — classic, quorum (Raft-based), streams (append-only log)
- Bindings — flexible routing rules
- Persistence — durable exchanges/queues + persistent messages
- Clustering — high availability across nodes
- Mirrored/Quorum queues — HA with replication
- Plugins — MQTT, STOMP, Federation, Shovel, Web STOMP
- Management UI — http://host:15672
- RabbitMQ Streams — append-only log (Kafka-like)
Architecture
Erlang processes are cheap and fault-tolerant. A RabbitMQ node runs thousands of Erlang processes per queue/connection. Cluster nodes share metadata via Mnesia DB (or Khepri in newer versions). Messages route through exchanges by binding rules.
Self-Hosting
# docker-compose.yml with clustering
version: "3"
services:
rabbit1:
image: rabbitmq:3-management
hostname: rabbit1
environment:
RABBITMQ_ERLANG_COOKIE: "secretcookie"
rabbit2:
image: rabbitmq:3-management
hostname: rabbit2
depends_on: [rabbit1]
environment:
RABBITMQ_ERLANG_COOKIE: "secretcookie"Key Features
- AMQP, MQTT, STOMP protocols
- Multiple exchange types
- Quorum queues (Raft)
- Streams (Kafka-like append log)
- Federation across clusters
- Shovel for cross-cluster forwarding
- Management UI and HTTP API
- Plugins ecosystem
- TLS and SASL auth
- Mature client libraries for every language
Comparison
| Broker | Protocol | Model | Best For |
|---|---|---|---|
| RabbitMQ | AMQP + more | Queues + exchanges | Task queues, RPC, flexible routing |
| Kafka | Kafka | Distributed log | Event streaming, analytics |
| NATS | NATS | Subject-based pub/sub | Low-latency microservice comms |
| Redis Streams | Redis | Log + consumer groups | Lightweight streams |
| ActiveMQ | AMQP + JMS | Queues + topics | Legacy Java systems |
FAQ
Q: RabbitMQ vs Kafka? A: RabbitMQ is a traditional MQ (flexible routing, task queues, RPC, low-latency async); Kafka is a distributed log (event streaming, long retention, high throughput). The choice depends on whether you need queue semantics or stream semantics.
Q: Classic vs Quorum queue? A: Quorum is the new Raft-based HA queue type in v3.8+ and is recommended for production. Classic mirrored queues are deprecated after v3.12.
Q: How large does it scale? A: A single node supports tens of thousands of connections and tens of thousands of messages per second. Clusters scale higher. For very high throughput (millions/sec), Kafka is recommended.
Sources
- Docs: https://www.rabbitmq.com/documentation.html
- GitHub: https://github.com/rabbitmq/rabbitmq-server
- License: MPL 2.0