2
votes

I am running IBM Websphere MQ on a Windows Server 2008 machine. Now I would like to know how you can view the content of messages in a specific queue, for example:

There are 2 messages in the SYSTEM.DEAD.LETTER.QUEUE. How do I view those messages so that I can see what is wrong with them?

I read up on IBM's website that you can do it like this:

C:\Program Files (x86)\IBM\WebSphere MQ\tools\c\Samples\Bin>amqsbcg SYSTEM.DEAD.LETTER.QUEUE
TLINKTT.QMAN

But when I run this, I get the following error:

AMQSBCG0 - starts here
**********************

 MQOPEN - 'SYSTEM.DEAD.LETTER.QUEUE'

 MQGET 1, failed with CompCode:2 Reason:2016
 MQCLOSE
 MQDISC 

Is this because the queue is in use? How else do I view messages in a Queue when a queue is in use?

Thanks

1

1 Answers

4
votes

A good tip for most MQ return codes is to run them through mqrc, e.g. run "mqrc 2016"

2016 0x000007e0 MQRC_GET_INHIBITED

So 2016 means the queue has been configured to prevent messages being got off the queue (gets are inhibited). A browse (amqsbcg for example) is just an open for MQOO_BROWSE, and then get with browse (eg. MQGMO_BROWSE_NEXT). So the issue here isnt that the queue is in use, more that the systems admin has prevented people from getting messages which end up at that queue.

To run e.g. amqsbcg against it you will need to enable gets first... runmqsc ALTER queue, get ENABLED to enable gets, or use the explorer GUI to do the same. It might make sense to put it back to disabled once done, so you leave it as you found it.