ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MQGET node output to no message when queue contain messages.

Post new topic  Reply to topic
 MQGET node output to no message when queue contain messages. « View previous topic :: View next topic » 
Author Message
kathirvelt
PostPosted: Wed Jan 21, 2015 12:33 pm    Post subject: MQGET node output to no message when queue contain messages. Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Wed Jan 21, 2015 12:47 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
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
View user's profile Send private message
kathirvelt
PostPosted: Wed Jan 21, 2015 1:02 pm    Post subject: Reply with quote

Apprentice

Joined: 02 Oct 2010
Posts: 32

Yes, I tested with MQGMO_BROWSE_FIRST alone, second message to the flow always goes to no message when the previous connection to the queue is open.

I just tested the MQGMO_BROWSE_FIRST + MQGMO_BROWSE_NEXT based this link.

http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.0.1/com.ibm.mq.csqzak.doc/fr41180_.htm?lang=en
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Jan 21, 2015 1:12 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
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
View user's profile Send private message
mqjeff
PostPosted: Wed Jan 21, 2015 1:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jan 21, 2015 1:15 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kathirvelt wrote:
I just tested the MQGMO_BROWSE_FIRST + MQGMO_BROWSE_NEXT based this link.

http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.0.1/com.ibm.mq.csqzak.doc/fr41180_.htm?lang=en


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
View user's profile Send private message
kathirvelt
PostPosted: Wed Jan 21, 2015 1:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Thu Jan 22, 2015 12:46 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
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
View user's profile Send private message
kathirvelt
PostPosted: Thu Jan 22, 2015 7:47 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Thu Jan 22, 2015 1:21 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MQGET node output to no message when queue contain messages.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.