Problem
Poison messages that always fail can be retried forever, blocking queues and burning resources. Discarding them silently loses data, and leaving them in place stalls healthy traffic.
Isolate messages that repeatedly fail processing so that they neither block the pipeline nor get lost.
Poison messages that always fail can be retried forever, blocking queues and burning resources. Discarding them silently loses data, and leaving them in place stalls healthy traffic.
A dead letter queue is a holding area for messages that cannot be processed. It converts an infinite retry loop or silent drop into a visible, manageable backlog of exceptions.
The consumer attempts processing and, on failure, retries with backoff up to a limit. Transient errors such as timeouts are retried; permanent errors such as schema violations skip straight to the dead letter queue. The broker or consumer moves the message there with headers describing the failure reason, stack summary, original queue, and attempt count. An alert fires when depth or age crosses a threshold. After investigation, engineers fix the code or data and redrive the messages, or discard them with an audit record.
{
"QueueName": "orders",
"RedrivePolicy": {
"deadLetterTargetArn": "arn:aws:sqs:us-east-1:123456789012:orders-dlq",
"maxReceiveCount": 5
},
"VisibilityTimeout": 60
}
Teams adopt this approach when asynchronous pipelines process messages with occasional bad data; message loss is unacceptable but blocking is too costly. It is a poor fit when messages are disposable telemetry where loss is acceptable, or when processing is synchronous and errors can be returned to the caller. The central tensions are retry persistence vs pipeline throughput; automation of redrive vs manual review; retention length vs data protection. The main benefits are that it delivers: healthy traffic keeps flowing despite poison messages; no silent data loss; failures become inspectable and replayable; provides a clear operational signal. The main costs to budget for are: the queue becomes a graveyard if nobody owns it; replay can duplicate effects without idempotency; messages may hold sensitive data needing protection; ordering guarantees can be broken by diversion. Governance typically looks like this: named team owns triage with defined service level for resolution. Expect adoption cost to be low: broker feature plus runbooks and alerts, and a best fit for any team using message brokers or event streams. Critics point out that DLQs often become unmonitored dumping grounds, and that replaying messages without idempotency can cause duplicate side effects. Treat these concerns as design inputs, and revisit the decision as traffic, team size, and failure history change.