Dead Letter Queue
Subject: Computer and Technology noun /ˈdɛd ˌlɛt.ər kjuː/ 1 definition
- distributed-systems
- message-queuing
- fault-tolerance
- software-architecture
-
Definition (noun)
Entry #246 · UpdatedA Dead Letter Queue (DLQ) is a specialized holding queue in asynchronous messaging systems that isolates messages a broker or consumer cannot deliver or process successfully. When a message fails repeatedly due to malformed payloads, schema mismatches, downstream outages, or expired time-to-live (TTL) limits, the system routes it out of the primary pipeline once a configured failure threshold is reached. By removing these "poison" messages from active traffic, a DLQ prevents head-of-line blocking and infinite retry loops while preserving failed payloads and error metadata for debugging, alerting, and selective replay.
Common Forms
Broker-Native DLQs: Built-in message broker features (such as Amazon SQS redrive policies, RabbitMQ dead-letter exchanges, or Azure Service Bus DLQs) that automatically move messages after exceeding maximum delivery counts, queue capacity limits, or TTL windows.
Consumer-Published DLQs: Application-level error pipelines commonly used with append-only event logs like Apache Kafka, where consumers catch deserialization or processing exceptions and explicitly forward the failed record and error metadata to a dedicated dead-letter topic.
Staged Retry and Parking Queues: Multi-tier topologies that route transient failures through delayed retry queues with backoff intervals before transferring persistently failing records into a terminal DLQ for manual triage.
Shared vs. Per-Source DLQs: Organizational topologies that either consolidate failures from multiple pipelines into a centralized monitoring queue or assign a dedicated DLQ per source queue to preserve schema isolation and access controls.
Example
An e-commerce payment worker consumes events from an Amazon SQS queue configured with a redrive policy of three maximum receives, causing a malformed JSON message missing a required currency field to fail validation three times in a row. Rather than blocking newer transactions or trapping workers in an infinite retry loop, SQS automatically moves the message to
payments-dlq, where an engineer inspects the payload, fixes the upstream serializer, and replays the corrected event.