About this chapter
A message that arrives is not the same as a message that gets done. In this chapter we close the gaps: how consumers confirm work with acknowledgements, how producers learn the broker actually stored a message, how to expire and retry messages, and what "delivery guarantee" really means once you accept that duplicates happen.
Lessons from courses
- 1 Acknowledgements deep dive How RabbitMQ manual acknowledgements work: the unacked state, redelivery when a consumer crashes, basic_nack and basic_reject with requeue, and redelivered.
- 2 Publisher confirms RabbitMQ publisher confirms tell a producer the broker stored a message. Learn confirm_select, wait_for_pending_acks, and how they differ from consumer acks.
- 3 Message and queue TTL Set a RabbitMQ message TTL on messages or whole queues: per-message expiration, x-message-ttl, x-expires, and how expired messages can dead-letter.
- 4 Retries and dead-letter queues Build a RabbitMQ retry and dead-letter queue pattern: a wait queue with TTL that dead-letters back to the main queue, plus a DLQ for poison messages.
- 5 Delivery guarantees RabbitMQ at-least-once vs at-most-once delivery, why duplicates happen on redelivery, why exactly-once is a myth, and how idempotent consumers fix it.
- 6 Delayed messages Send a RabbitMQ delayed message: the TTL plus dead-letter trick, and the rabbitmq-delayed-message-exchange plugin with x-delay, plus when to use each.