2

We see on a particular queue where messages are coming from SAP, the get call is skipping messages sometimes.

In one of the scenarios, the first message was skipped and it picked all the messages arrived in the queue later.

We are suspecting, maybe this one is uncommitted message or committed later and the Browse cursor moved ahead based on the sequence.

It is not even re-scanning to see if any message is stuck.

Please suggest if you have any thoughts on this? How can we know if the skipped message is actually uncommitted message and committed later.

Is there any command to see the details..

How to mitigate such scenario?

queueManagerIn = new MQQueueManager(MQManagerName, connectionProperties);

queueIn = queueManagerIn.AccessQueue(MQQueueNameIn, MQC.MQOO_BROWSE + MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE);
MQGetMessageOptions MQMessageOptions = new MQGetMessageOptions();

// Wait time in milli seconds. Will how often it goes through the whole loop again 
// and how long the shutdown has to wait for this function to exit.
MQMessageOptions.WaitInterval = getWaitInterval;

MQMessageOptions.Options = MQC.MQGMO_BROWSE_NEXT + MQC.MQGMO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;

MQMessage queueMessage = new MQMessage();
queueIn.Get(queueMessage, MQMessageOptions);
2
  • DISPLAY QSTATUS and look at the UNCOM attribute to see if currently any uncommitted. Hard to tell after the fact though. Suggest browse + mark might help - let me know if you need me to expand and I will write an answer. Commented Aug 7 at 12:13
  • Thanks @MoragHughson. We don't want to change the code for now, but will try this: DISPLAY QSTATUS and look at the UNCOM attribute to see if currently any uncommitted.
    – b_patil
    Commented Aug 7 at 13:47

1 Answer 1

3

You can see if there are any uncommitted messages on the queue by looking at the queue depth in the console and comparing to the actual number of messages listed for that queue in the console.

e.g. Queue depth of 4 with only 3 visible messages means that there is one uncommitted message for that queue.


In response to your recent comment:

"An uncommitted message is never visible to a browse; the browse cursor skips past it. Messages within a unit-of-work cannot be browsed until the unit-of-work is committed. Messages do not change their position on the queue when committed, so skipped, uncommitted messages will not be seen, even when they are committed, unless you use the MQGMO_BROWSE_FIRST option and work though the queue again."

https://www.ibm.com/docs/en/ibm-mq/9.3?topic=queue-browse-cursor#q026470___uncommitted_messages__title__1

4
  • Ok. What if the message committed at the later stage.
    – b_patil
    Commented Aug 7 at 10:43
  • Once committed, the message will be visible in the list of messages on that queue in the console, and the queue depth will match the number of messages you see. (provided that there are no other uncommitted messages)
    – sjain
    Commented Aug 7 at 10:48
  • Lets say, 1, 2, 3, 4 messages arrived in the queue. 1 is uncommitted and 2. 3, 4 are committed messages. The Browse cursor on the Get call, picked 2,3,4 and processed, now the 1st one committed, would the cursor go-back and pick that one message which is committed later? Sorry for too many questions, but I need to understand the cause.
    – b_patil
    Commented Aug 7 at 11:27
  • Have a look at my updated answer
    – sjain
    Commented Aug 7 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.