pattern

Dead Letter Queue

also called DLQ

A separate queue that receives messages which could not be processed after a set number of attempts, so they neither block the consumer nor disappear.

messagingerrorsoperations

Without one, a message that always fails has two possible fates and both are bad: it is retried forever, blocking everything behind it if ordering is preserved, or it is discarded and the data is silently lost.

A DLQ turns a poison message into an operational item. The essentials: a redelivery limit that triggers the move, enough context captured with the message to diagnose it (the error, the attempt count, the original timestamp), an alarm on depth greater than zero — a DLQ nobody watches is a slower form of losing the message — and a replay path to put fixed messages back after the bug is deployed.

Worth distinguishing two causes when triaging: a malformed message that will never succeed, and a valid message that failed because a dependency was down. Only the second should be replayed wholesale.