Dead-letter Queue

Abbreviation: DLQ. Also known as: dead letter queue, dead-letter exchange.

A separate holding place for messages or jobs that could not be processed under the normal delivery and retry rules.

Synthetic dataExamples on this page use synthetic data created for illustration.

Definition

A dead-letter queue is a separate holding place for messages or jobs that normal processing could not complete. Items may move there after repeated rejection, expiry or exhausted retries. It preserves failed work for inspection and deliberate recovery without letting one bad item block the main queue.

In plain terms

Some jobs will never succeed unchanged: the input is invalid, a required account no longer exists, or the retry limit has been reached. Rather than retry forever or delete the evidence, the system moves them aside with their error history.

A dead-letter queue needs an owner and a process. Someone must inspect its contents, fix or discard items for a stated reason, and decide whether replay is safe. Without that routine, it is merely a quieter place to lose work.

Example

A queue allows three attempts. Job J fails each time because a required field is absent. After the third failure it moves to the dead-letter queue with the original payload, attempt summaries and last error.

An operator corrects the source record and creates a new job linked to J. Replaying the old payload unchanged would only repeat the failure, so the recovery action is recorded rather than automatic.

Common misunderstandings

  • “Dead-letter means deleted.” The item is retained separately for inspection; retention still needs a limit.
  • “Everything that fails belongs there immediately.” Temporary failures may deserve bounded retry first.
  • “Replaying the queue is always safe.” The original work may have partly succeeded; check Idempotency and side effects before replay.
  • “A DLQ needs no monitoring.” Growth is a failure signal and should be visible, owned and reviewed.

References

  1. Dead Letter Exchanges . RabbitMQ.