Durable Work Queue
Create a producer/consumer pair where tasks survive broker restarts and are manually acknowledged.
Backend & Runtime / Knowledge library
message broker for reliable async communication
RabbitMQ decouples backend services with asynchronous messaging so systems can handle traffic spikes, isolate failures, retry work, and route events reliably.
RabbitMQ began in 2007 as an open-source AMQP message broker. It is implemented in Erlang/OTP, leveraging the BEAM runtime for concurrency and fault tolerance. RabbitMQ 3.8 introduced quorum queues (Raft-based replication) for stronger data safety. RabbitMQ 3.9 introduced streams for high-throughput, log-style messaging workloads. RabbitMQ 4.x removes classic mirrored queues and reinforces modern queue/stream patterns.
Work through these exercises in order. Try the task before opening a reference.
Create a producer/consumer pair where tasks survive broker restarts and are manually acknowledged.
Implement a retry queue with TTL and dead-letter exchange to reprocess failed jobs up to 3 times.
Design exchanges, routing keys, and consumer prefetch settings for order.created, order.paid, and order.failed events with backpressure.
Plan a migration from classic mirrored queues to quorum queues with minimal downtime and rollback steps.
Add metrics and alerts for queue depth, consumer lag, unacked messages, and connection churn; define SLOs.
A global retail enterprise managing high-frequency inventory updates across disparate regional warehouses and a centralized e-commerce storefront.
Synchronous HTTP calls between the regional warehouse management systems and the central storefront frequently time out during peak traffic, leading to data inconsistency and lost sales opportunities when inventory counts fail to propagate.
RabbitMQ acts as a message broker to decouple the warehouse systems from the storefront. By using an asynchronous messaging pattern, the warehouse systems publish inventory updates to an exchange, which routes them to queues. The storefront consumes these updates at its own pace, ensuring that even if the storefront is temporarily overloaded, the inventory messages remain safely stored in the broker until processed.
This diagram illustrates the path of an inventory update from a warehouse to the storefront via RabbitMQ.
Producer of inventory data
Routes messages to appropriate queues
Durable storage for pending updates
Consumer of inventory data
The storefront maintains eventual consistency with warehouse inventory without blocking warehouse operations, resulting in a more resilient architecture that gracefully handles transient traffic spikes.
The primary limitation is the risk of queue buildup if consumers fail or cannot keep pace with the producer rate. This can be checked by monitoring the message count in the RabbitMQ management interface, where a continuously increasing depth indicates a bottleneck in the consumer service.