# Dead letter queue

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Dead_letter_queue
> Markdown URL: https://mediated.wiki/source/Dead_letter_queue.md
> Source: https://en.wikipedia.org/wiki/Dead_letter_queue
> Source revision: 1339507037
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Term used in message queueing}}
In [message queue](/source/message_queue)ing a '''dead letter queue''' (DLQ), or '''dead letter topic''' (DLT) in some messaging systems,  is a service implementation to store messages that the messaging system cannot or should not deliver.<ref>{{cite web|url=https://www.enterpriseintegrationpatterns.com/patterns/messaging/DeadLetterChannel.html|title=Dead Letter Channel|website=www.enterpriseintegrationpatterns.com}}</ref> Although implementation-specific, messages can be routed to the DLQ for the following reasons:

# The message is sent to a queue that does not exist.<ref name="redkar">{{cite book|last=Redkar|first=Arohi|title=Pro MSMQ: Microsoft Message Queue Programming|publisher=Apress|year=2004|isbn=1430207329|pages=148}}</ref><ref>{{cite web|url=http://pic.dhe.ibm.com/infocenter/wmqv7/v7r1/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fic10420_.htm|title=Dead-letter queues|publisher=IBM|accessdate=23 February 2014}}</ref> 
# The maximum queue length is exceeded.
# The message exceeds the size limit.
# The message expires because it reached the [TTL (time to live)](/source/Time_to_live)<ref>{{Cite web|title=Dead Letter Exchanges — RabbitMQ|url=https://www.rabbitmq.com/dlx.html|access-date=2020-12-06|website=www.rabbitmq.com}}</ref>
# The message is rejected by another queue exchange.<ref name="rabbitmq">RabbitMQ dead letter queue {{cite web|url=https://www.rabbitmq.com/dlx.html|title=Dead Letter Exchanges|access-date=2016-05-06|archive-date=2016-05-05|archive-url=https://web.archive.org/web/20160505104043/http://www.rabbitmq.com/dlx.html|url-status=live}}</ref>
# The message has been read and rejected too many times.<ref>{{Cite web|title=Amazon SQS dead-letter queues|url=https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html|publisher=AWS|access-date=2023-04-14|archive-date=2023-04-14|archive-url=https://web.archive.org/web/20230414162538/https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html|url-status=live}}</ref>

Routing these messages to a dead letter queue enables analysis of common fault patterns and potential software problems.<ref name="amazon"/> If a message consumer receives a message that it considers invalid, it can instead forward it an Invalid Message Channel,<ref>{{Cite web|title=Invalid Message Channel|url=https://www.enterpriseintegrationpatterns.com/patterns/messaging/InvalidMessageChannel.html|website=www.enterpriseintegrationpatterns.com|access-date=2023-04-14|archive-date=2023-04-14|archive-url=https://web.archive.org/web/20230414162539/https://www.enterpriseintegrationpatterns.com/patterns/messaging/InvalidMessageChannel.html|url-status=live}}</ref> allowing a separation between application-level faults and delivery failures. 

Management of dead letter queues typically involves monitoring and alert systems. Organizations may implement specialized handlers for automated remediation or manual processing of DLQ messages.

Queueing systems that incorporate dead letter queues include [Amazon EventBridge](/source/Amazon_EventBridge),<ref name="amazoneb">{{cite web |url= https://aws.amazon.com/it/about-aws/whats-new/2020/10/amazon-eventbridge-announces-support-dead-letter-queues |title= Amazon EventBridge announces support for Dead Letter Queues |publisher= Amazon |access-date= 2020-10-30 |archive-date= 2024-12-17 |archive-url= https://web.archive.org/web/20241217225540/https://aws.amazon.com/it/about-aws/whats-new/2020/10/amazon-eventbridge-announces-support-dead-letter-queues/ |url-status= live }}</ref> [Amazon Simple Queue Service](/source/Amazon_Simple_Queue_Service),<ref name="amazon">{{cite web|url=http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html|title=Using Amazon SQS Dead Letter Queues|publisher=Amazon|accessdate=23 February 2014}}</ref> [Apache ActiveMQ](/source/Apache_ActiveMQ), [Google Cloud Pub/Sub](/source/Google_Cloud_Platform),<ref>{{Cite web|title=Forwarding to dead-letter topics {{!}} Cloud Pub/Sub|url=https://cloud.google.com/pubsub/docs/dead-letter-topics|access-date=2020-12-26|website=Google Cloud|language=en}}</ref> [HornetQ](/source/HornetQ), [Microsoft Message Queuing](/source/Microsoft_Message_Queuing),<ref name="redkar"/> Microsoft Azure Event Grid and Azure Service Bus,<ref>{{Cite web|url=https://docs.microsoft.com/en-us/azure/event-grid/compare-messaging-services?toc=%2fazure%2fservice-bus-messaging%2ftoc.json|title=Compare Azure messaging services|last=spelluru|date=|website=docs.microsoft.com|language=en-us|archive-url=|archive-date=|access-date=2020-01-17}}</ref> [WebSphere MQ](/source/WebSphere_MQ),<ref>{{cite book|last=Böhm-Mäder|first=Johannes|title=WebSphere MQ Security: Tales of Scowling Wolves Among Unglamorous Sheep|date=14 December 2011 |publisher=BoD|pages=68|isbn=978-3842381506}}</ref> [Solace Platform](/source/Solace_Corporation),<ref>{{cite web|url=https://docs.solace.com/Configuring-and-Managing/Setting-Dead-Msg-Queues.htm|title=Solace Dead Message Queues}}</ref> [Rabbit MQ](/source/Rabbit_MQ),<ref name="rabbitmq"/> Confluent Cloud<ref name="confluent_cloud">{{cite web|url=https://docs.confluent.io/cloud/current/connectors/dead-letter-queue.html|title=Confluent Cloud documentation|access-date=2021-02-12|archive-date=2021-03-04|archive-url=https://web.archive.org/web/20210304102205/https://docs.confluent.io/cloud/current/connectors/dead-letter-queue.html|url-status=live}}</ref> and [Apache Pulsar](/source/Apache_Pulsar).<ref name="pulsardoc">{{cite web|url=https://pulsar.apache.org/docs/en/concepts-messaging/#dead-letter-topic|title=Apache Pulsar documentation}}</ref><ref name="pulsarpip22">{{cite web|url=https://github.com/apache/pulsar/wiki/PIP-22:-Pulsar-Dead-Letter-Topic|title=Apache Pulsar PIP-22:Dead Letter Topic|website=[GitHub](/source/GitHub) }}</ref>

== See also ==

* [Poison message](/source/Poison_message)
* [Dead letter mail](/source/Dead_letter_mail)

==References==
{{reflist}}

Category:Inter-process communication
Category:Events (computing)

---
Adapted from the Wikipedia article [Dead letter queue](https://en.wikipedia.org/wiki/Dead_letter_queue) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Dead_letter_queue?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
