Author |
Message
|
kathirvelt |
Posted: Wed Jan 21, 2015 12:33 pm Post subject: MQGET node output to no message when queue contain messages. |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
Hi,
I'm building a flow to consume a message and browse a queue for existing message and if it matches with some value need to route to error queue otherwise continue with process. There are already couple of post related to this.
My flow contain below scenario.
MQ input -> compute (loop) -> MQ Get->MQ output.
When first message arrive to the flow working as expected. When second message arrive MQGet is not browsing the message and going out to no message.
Before the MQGET in compute node I'm setting the below options, still node is coming out of "no message" for the second message.
SET OutputLocalEnvironment.MQ.MQGET.MQGMO.Options = MQGMO_BROWSE_FIRST + MQGMO_BROWSE_NEXT;
I observed that after the first message got processed, open count is set to 1 for that MQGET queue, when queue connection handle is closed and when it becomes 0, MQGET is browing the message from queue.
Any suggestions?
Last edited by kathirvelt on Wed Jan 21, 2015 1:13 pm; edited 1 time in total |
|
Back to top |
|
 |
zpat |
Posted: Wed Jan 21, 2015 12:47 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If you want the first message on the queue each time, why not remove the browse next and leave just the browse first option?
If you read the documentation on browse first - it clearly says
Quote: |
This option is not valid with any of the following options:
MQGMO_BROWSE_MSG_UNDER_CURSOR
MQGMO_BROWSE_NEXT
MQGMO_MSG_UNDER_CURSOR
MQGMO_SYNCPOINT
MQGMO_UNLOCK.
It is also an error if the queue was not opened for browse.
|
_________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
kathirvelt |
Posted: Wed Jan 21, 2015 1:02 pm Post subject: |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
|
Back to top |
|
 |
zpat |
Posted: Wed Jan 21, 2015 1:12 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If the messages are being consumed - something is not right.
Make sure you are not consuming them under syncpoint and rolling them back (instead of actually browsing). _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 21, 2015 1:13 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You need to BROWSE_FIRST on the first time, and BROWSE_NEXT on the rest of them. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 21, 2015 1:15 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
That link points to an MQCB operation, not the MQGet operation the node is performing. You can't (as my associate points out) specify a browse first and a browse next on the same call. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kathirvelt |
Posted: Wed Jan 21, 2015 1:24 pm Post subject: |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
I have just enabled "Browse only" in request section.
I changed the code as below and tested still same result.
Code: |
SET OutputLocalEnvironment.MQ.MQGET.MQGMO.Options = MQGMO_BROWSE_FIRST;
PROPAGATE TO TERMINAL 'out' DELETE NONE;
WHILE(Environment.values.QueueFlag = 1) DO
SET OutputLocalEnvironment.MQ.MQGET.MQGMO.Options = MQGMO_BROWSE_NEXT;
PROPAGATE TO TERMINAL 'out' DELETE NONE;
END WHILE;
|
|
|
Back to top |
|
 |
zpat |
Posted: Thu Jan 22, 2015 12:46 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
kathirvelt wrote: |
I have just enabled "Browse only" in request section.
I changed the code as below and tested still same result.
Code: |
SET OutputLocalEnvironment.MQ.MQGET.MQGMO.Options = MQGMO_BROWSE_FIRST;
PROPAGATE TO TERMINAL 'out' DELETE NONE;
WHILE(Environment.values.QueueFlag = 1) DO
SET OutputLocalEnvironment.MQ.MQGET.MQGMO.Options = MQGMO_BROWSE_NEXT;
PROPAGATE TO TERMINAL 'out' DELETE NONE;
END WHILE;
|
|
You may need to re-initialize some other MQ values between each MQGET.
It's possible the results of the first MQGET are affecting the next one.
If the queue has a depth of more than one, but on the second MQGET the "no message" terminal is taken - it suggests that maybe it is trying to match a particular message and not finding it.
Make sure the Match Options flags are not inadvertently set and I suggest you clear the MQMD.Msgid and MQMD.correlid fields to null as well before each MQGET. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
kathirvelt |
Posted: Thu Jan 22, 2015 7:47 am Post subject: |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
Thanks zpat.
As you suggested, I set null value to MsgID and CorrelID and issue got resolved. For each message MQGET is browsing the queue as expected.
Code: |
SET OutputLocalEnvironment.MQ.GET.MQGMO.Options = MQGMO_BROWSE_FIRST;
WHILE(Environment.values.QueueFlag = 1) DO
SET OutputRoot.MQMD.MsgId = NULL;
SET OutputRoot.MQMD.CorrelId = NULL;
PROPAGATE TO TERMINAL 'out' DELETE NONE;
SET OutputLocalEnvironment.MQ.GET.MQGMO.Options = MQGMO_BROWSE_NEXT;
END WHILE;
|
|
|
Back to top |
|
 |
zpat |
Posted: Thu Jan 22, 2015 1:21 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
 _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
|