NotesSystem

RabbitMQ

Also: Rabbit · AMQP Broker

The classic queue broker. Producers publish to exchanges that route messages into queues, and the broker pushes each message to one consumer and deletes it on ack. It tracks every message, so per-message acks, routing, TTLs and dead-lettering are first-class.

Also in: Message Brokers & Logs › In the real world

Design choices

  • Message Broker (queue model): exchanges (direct, topic, fanout, headers) route into queues, and consumers compete for messages.
  • Flow control: consumer prefetch caps the unacked deliveries per channel; the docs suggest 100–300 as typical. Unacked messages are requeued when a channel closes.
  • Replication by Raft: quorum queues (since 3.8, 2019). Classic mirrored queues were removed in 4.0 (2024).
  • Dead Letter Queues: dead-letter exchanges catch rejected, expired, overflowed or over-delivered messages. Quorum queues default to a delivery limit of 20 since 4.0.
  • Streams (since 3.9, 2021): an append-only, replayable log type alongside queues, a Log-Based Message Broker inside RabbitMQ.
  • AMQP 1.0 has been a core protocol since 4.0, next to AMQP 0-9-1, MQTT and STOMP.

Notable trade-offs

  • Flexible routing and per-message control. On the other hand, no replay for classic queues, and ordering is lost once redelivery happens.
  • The broker holds per-message state, so very deep backlogs cost memory and throughput. It's built for queues that drain.