Amazon SQS
Dead-Letter Queues
Isolate messages that repeatedly fail so they stop blocking the queue and can be investigated.
An SQS dead-letter queue (DLQ) is an ordinary queue designated as the destination for messages that fail processing too many times. You attach a redrive policy to the source queue specifying a DLQ and a maxReceiveCount; once a message has been received (and not deleted) that many times, SQS moves it to the DLQ automatically.
A returns desk in a warehouse: a package that fails delivery a few times is pulled off the normal conveyor and set aside in a dedicated area where staff examine why, fix it, and re-introduce it — instead of it circling the belt forever.
Key Concepts
1
This prevents poison messages — ones that always fail — from being redelivered endlessly, consuming throughput and blocking healthy traffic. The DLQ becomes a quarantine you can monitor, alarm on (queue depth > 0), inspect, fix, and optionally redrive back to the source queue once the underlying bug is resolved.
2
A FIFO source queue must use a FIFO DLQ, and a Standard source a Standard DLQ. It is also good practice to set a longer retention on the DLQ than the source so you have time to react.