RabbitMQ 00:00:01 An invoice has to reach its queue A bookshop publishes an invoice event to RabbitMQ. The producer supplies an exchange and routing information. Receiving the publish at the broker does not by itself mean the billing queue has a matching binding. A direct exchange compares the routing key with a binding key for an exact match. A topic exchange applies a binding pattern. The words in a routing key let related events take different routes. A fanout exchange delivers a copy to each bound queue without selecting on the routing key. With no eligible queue, the exchange cannot enqueue the invoice. Configure and observe what should happen to an unroutable publication. Choose the exchange against the routing contract. A publisher that needs to know that no queue matched must handle the appropriate returned-message behavior as well as confirms. 00:00:54 A publisher confirm and a worker acknowledgement Track two acknowledgements with different recipients. The broker confirms the publication to the shop. Later, the worker acknowledges delivery to the broker after its own work succeeds. The message is persistent and carries a routing key. The publisher waits for a confirm. Only now does the broker confirm. The publisher may forget the message. The worker fails before acknowledging. An unacknowledged delivery can be requeued when the channel or connection closes. The work finishes and the ack arrives. Now the queue deletes the message. If a worker committed an invoice but lost its acknowledgement, the same delivery can return. Use a durable invoice identifier to recognize an effect already applied. 00:01:42 Stop one slow worker hoarding invoices A fast worker is idle while a slower one holds a batch of unacknowledged deliveries. Queue depth alone hides the imbalance because those invoices have already left the ready queue. Ten messages are handed out at once, five each. The fast worker is done. Four messages still wait in the slow worker's hands. Each worker holds one. The other eight stay in the queue for whoever is free. While the slow worker does its first, the fast one finishes five. Prefetch bounds outstanding deliveries per consumer according to configuration. Tune it against work duration and round-trip cost, and observe both ready and unacknowledged counts. 00:02:25 A quorum queue loses a member A three-member quorum queue replicates its log. The leader coordinates writes, and reaching a majority lets the queue keep making progress after one member fails. The leader appends and sends the message to both followers. Two of three are a majority, so it confirms. Leader and one follower are still a majority. Nothing changes for clients. Nodes 2 and 3 elect a leader among the up-to-date ones. Every confirmed message is there. One of three is no majority. The queue stops confirming and delivering until a second member is back. Losing two of three prevents a majority even if the final member is healthy. Replication is a concrete failure budget with a latency and storage cost. 00:03:13 Give a persistently failing invoice a destination One malformed invoice repeatedly fails business validation. Redelivery is helpful after a transient interruption, but endlessly retrying this same item can consume capacity needed for valid invoices. The consumer rejects with requeue. The delivery count becomes 1, so the message waits 1 minute. Count 3: 3 minutes. The wait grows by the same step each time, up to the maximum. A fourth failure passes the limit of 3. The queue hands the message to the dead-letter exchange. Headers say where it came from and why. Fix the cause, then publish it again to the first exchange. Use bounded retries, a dead-letter policy and a clear repair owner. Replaying after repair still needs the same invoice identity that protected the first delivery.