If messages are not delivered successfully and are therefore placed on the dead-letter
queue, you can browse the queue and decide how to dispose of any messages that you find.
About this task
Messages that cannot be delivered for some reason are placed on the dead-letter queue. Each queue
manager typically has a local queue to use as a dead-letter queue, so that messages that cannot be
delivered to their correct destination can be stored for later retrieval.
Procedure
-
Check whether the queue contains any messages by using the MQSC DISPLAY QUEUE
command.
- If the queue contains messages, use the provided browse sample application (amqsbcg) to
browse messages on the queue using the MQGET call.
The sample application steps through
all the messages on a named queue for a named queue manager, displaying both the message descriptor
and the message context fields for all the messages on the named queue.
- Decide how to dispose of any messages found on the dead-letter queue, depending on the
reasons for the messages being put on the queue.
Problems might occur if you do not associate a dead-letter queue with each queue manager.
IBM® MQ provides a dead-letter queue handler that
allows you to specify how messages found on a dead-letter queue are to be processed or removed. For
more information about dead-letter queues and handling undelivered messages, see Working with dead-letter queues.