advanced

RabbitMQ for task queues and flexible routing

Choose RabbitMQ when work queues, low-latency command delivery, acknowledgements, dead-lettering, and rich broker routing dominate.

Choose RabbitMQ when work-queue semantics, flexible routing, per-message acknowledgements, and low-latency command delivery matter more than long-term log retention. Task distribution, RPC-style request/reply, priority queues, and complex routing via exchanges fit RabbitMQ's broker-centric model.

RabbitMQ excels at competing consumers, dead-lettering, TTL delays, and operational patterns teams already know from AMQP. It is weaker as an immutable event history store — processed messages leave the queue.

On interviews: justify RabbitMQ for an order-fulfillment worker pool, explain exchange routing benefits, and state when you would migrate toward Kafka.

Common pitfalls: expecting unlimited replay from queues; running RabbitMQ without monitoring memory and disk alarms; classic mirrored queues without migration plan to quorum; using it for multi-TB analytics ingestion.

The trade-off is flexibility versus complexity—know when the simpler path is enough.

Checklist:

  • Match task-queue and routing needs to AMQP model.
  • Plan ack, retry, and DLX from day one.
  • Monitor broker memory and queue depth.
  • Document message lifecycle after consumption.