RabbitMQ
Architecture
Understand RabbitMQ as a smart broker built on the AMQP model: exchanges route, queues store.
RabbitMQ is a traditional message broker implementing the AMQP 0-9-1 model. Unlike Kafka, the broker is "smart" and does the routing work, while consumers are relatively simple. The core insight is the separation between exchanges and queues: producers never publish directly to a queue, they publish to an exchange, which decides which queue(s) receive the message based on bindings.
A mailroom: you drop a letter at the sorting desk (exchange) with an address (routing key). The clerk consults the routing chart (bindings) and places it into the correct pigeonholes (queues), where recipients (consumers) collect and sign for it.
Key Concepts
1
A queue is an ordered buffer that holds messages until a consumer acknowledges them. Once all consumers have acknowledged a message, it is gone — there is no replay of consumed messages as in Kafka. This makes RabbitMQ a natural fit for task distribution and request/reply.
2
RabbitMQ supports rich routing, per-message TTL, priorities, dead-lettering, and flexible delivery, at the cost of lower raw throughput than Kafka. Clustering and quorum queues provide high availability.