What is Dead Letter Queue?

Turkish: Dead Letter Queue

A dead letter queue separates messages that cannot be processed so teams can inspect errors, retry safely, and avoid data loss.

What is a Dead Letter Queue?

A dead letter queue (DLQ) is a separate queue where messages are moved after they fail processing beyond a defined retry limit. It keeps problematic messages from blocking the main flow while still preserving them for investigation.

For example, if an order message is missing a required customerId, the consumer service may fail. Retrying that same message forever can clog the queue. A DLQ isolates it so the team can inspect the error and, if appropriate, fix and replay the message.

How Does It Work?

Message-processing systems usually define retry count, backoff timing, error types, and the DLQ destination. Each failure triggers the retry policy; when the limit is reached, the message is routed to the dead letter queue.

A good DLQ setup includes:

  • Metadata such as failure reason, retry count, and timestamp
  • Alerts and monitoring rules
  • A procedure to fix and replay messages
  • Protection against poison messages entering an infinite loop
  • Retention rules for payloads containing personal or sensitive data

Business Use

DLQs reduce data-loss risk in payment, invoicing, notification, inventory update, and integration workflows. In systems built on a message queue, making failures visible is better than silently dropping or endlessly retrying them.

Kafka, RabbitMQ, AWS SQS, and similar systems implement DLQ patterns in different ways. The value comes not from creating the queue alone, but from having a clear process for reviewing and safely reprocessing failed messages.