The problem it solves
A worker pulls a message, crashes on malformed data, the message returns to the queue, and the cycle repeats forever while healthy messages wait behind it. After a set number of attempts, the broker moves the poison message to a dead-letter queue instead.
What teams do with it
Someone looks at the stuck messages, finds the cause, fixes the code or the data, and replays them into the main queue. Without an alert on queue depth, the dead-letter queue becomes a graveyard of unsent invoices and unprocessed bookings that nobody notices.
Setup checklist
- Choose a retry limit that matches how long a temporary outage may last.
- Keep the original message and the error reason together.
- Alert when the count rises above zero.
- Define who owns replay and how long messages are kept. Amazon SQS, RabbitMQ, Azure Service Bus and Google Pub/Sub all offer the feature.
Questions, answered
Not automatically; they stay until their retention period ends, so replay them before then.
No. A log describes the failure; the dead-letter queue keeps the actual message so it can be reprocessed.