I need a query or just a command to see stopped/delayed/waiting messages in a queue, but for long time.
Websphere MQ – Query view message with long time in queue
ibm-mqqueuetime
ibm-mqqueuetime
I need a query or just a command to see stopped/delayed/waiting messages in a queue, but for long time.
Best Answer
Messages that are sitting on a queue and not being processed can be seen using the following command:-
First of all you can see the
CURDEPTH
value which very simply shows you how many messages there are on the queue. That single number does not itself reflect whether those messages arrived 1 second ago or 1 hour ago, it just shows you how many messages were on the queue at the time you issued the command. If there are applications processing the messages on that queue, you might well see a different number if you issued it again a moment later.There are various other fields that are returned on this command that will show you more information about how long messages are staying on this queue before being processed. If you are concerned that no application is getting the messages off the queue, you should check out
LGETDATE
andLGETTIME
which show you the date and time that the last message was got off the queue. If this is a while ago, it is worth also checking outIPPROCS
which show the count of applications which have the queue open for getting (Input).If you can see that applications are working on the queue, and that
LGETTIME
seems to be regularly changing suggesting that regular processing is happening, but your still think you have messages on the queue for a long time, you may have applications that are not getting the next message but instead are picking up specific messages by message-id or correlation-id. In this case although the queue is being regularly processed you may have some old messages and these will show up as a high value inMSGAGE
.N.B. Some of these fields caused additional time stamps to be taken by the queue manager code, specifically of those I mentioned,
LGETTIME
andMSGAGE
. These are controlled by theMONQ
attribute so that you do not spend this extra CPU time if you don't want to view this kind of data. Turn on these extra bits of information by issuing the command:-Related Information: