The WebSphere MQ dead-letter queue handler

 

A dead-letter queue (DLQ), sometimes referred to as an undelivered-message queue, is a holding queue for messages that cannot be delivered to their destination queues. Every queue manager in a network should have an associated DLQ.

Note:
It is often preferable to avoid placing messages on a DLQ. For information about the use and avoidance of DLQs, see the WebSphere MQ Application Programming Guide.

Queue managers, message channel agents, and applications can put messages on the DLQ. All messages on the DLQ must be prefixed with a dead-letter header structure, MQDLH. Messages put on the DLQ by a queue manager or by a message channel agent always have an MQDLH. Always supply an MQDLH to applications putting messages on the DLQ. The Reason field of the MQDLH structure contains a reason code that identifies why the message is on the DLQ.

In all WebSphere MQ environments, there must be a routine that runs regularly to process messages on the DLQ. WebSphere MQ supplies a default routine, called the dead-letter queue handler (the DLQ handler), which you invoke using the STRMQMDLQ command. A user-written rules table supplies instructions to the DLQ handler, for processing messages on the DLQ. That is, the DLQ handler matches messages on the DLQ against entries in the rules table. When a DLQ message matches an entry in the rules table, the DLQ handler performs the action associated with that entry.