A dead letter queue (DLQ) is a queue used to hold messages that could not be processed successfully after one or more retries.
Messages usually end up in a DLQ when:
- A consumer keeps failing on the same message
- The message is malformed or missing required data
- The message is too old to process usefully
- Downstream dependencies are unavailable for too long
Why people use it
DLQs keep failing messages out of the main processing path so normal traffic can continue.
They also make it easier to inspect and replay problematic messages later.
Common flow
- A producer sends a message to a main queue or topic
- A consumer tries to process it
- If processing fails too many times, the message is moved to a DLQ
- An operator or recovery job inspects the DLQ and decides what to do next
Compare
DLQs are not a replacement for fixing root causes. They are a containment mechanism.
- DLQs are part of Messaging failure handling
- Message Broker moves messages between producers and consumers
- Pubsub describes the delivery pattern
- Kafka may use retries and failure handling around consumers and partitions
- RabbitMQ commonly uses DLQs for queue-based workflows
Related ideas
- Retries
- Poison messages
- Backoff
- Message validation