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 » reading more than one message using MQGET

Post new topic  Reply to topic
 reading more than one message using MQGET « View previous topic :: View next topic » 
Author Message
nmaddisetti
PostPosted: Thu Mar 19, 2009 5:46 am    Post subject: reading more than one message using MQGET Reply with quote

Centurion

Joined: 06 Oct 2004
Posts: 145

Hi,

Our requirement is to read the multiple messages having same correlation id from the queue.

This is required because we have three flows in sequense.

flow1-->will trigger-->flow2-->will trigger-->flow3

in flow2 and flow3 we are reading messages using MQGET with matching message id( these message ids are available in DB and are inserted by flow1)

in certain scenarios flow1 may fail (message ids wont be available in DB)and we dont reach flow2 and flow3 then we want to delete the messages from these queues.

Client application who is putting messages on MQGET queues dont have capability to set expiration time.


I tried with MQGET but it is reading only one message from the queue.
Do I need to some configuration in MQGET to read all messages in the queue with same correlation id.

will MQGET support for reading multiple messages with same correlation id?

can you please through your thoughts to achive this functionality.

Thanks & Regards,
Venkat.
Back to top
View user's profile Send private message
pcelari
PostPosted: Thu Mar 19, 2009 6:18 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

You can certainly wire more than one MQGet nodes to the same out terminal of your MQInput node where your reply comes in, but connect only one of them to the down stream flow.

like this:

MQInput4Replies -> MQGet_1 -> downstream input terminal
-> MQGet_2
-> MQGet_3


This way, the two MQGet with no out terminal connected will result in the extra msg with matching CorrelId deleted.

Hope this helps.


_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
HOMETOWN47
PostPosted: Thu Mar 19, 2009 9:07 am    Post subject: Reply with quote

Apprentice

Joined: 25 Mar 2003
Posts: 34

You could always have the Out terminal of the MQGet node wired back to it's own In terminal. If you want to do processing on any messages you get from the node then also wire the out terminal to further nodes for processing. If you are just discarding the messages then wire the No message terminal to continue further processing once all the messages with the same Id have been retrieved.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Mar 19, 2009 9:21 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

HOMETOWN47 wrote:
You could always have the Out terminal of the MQGet node wired back to it's own In terminal


And then watch the Broker consume CPU and memory until the machine halts and catches fire.
Back to top
View user's profile Send private message
nmaddisetti
PostPosted: Thu Mar 19, 2009 10:18 am    Post subject: Reply with quote

Centurion

Joined: 06 Oct 2004
Posts: 145

Hi mqjeff,

You are right if we keep our flow in loop then broker will go down we have seen this one in one of our earlier project.

Can some one throw some light on MQGET to achieve the functionality mentioned above.

Thanks & Regards,
Venkat.
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Mar 19, 2009 10:25 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
Can some one throw some light on MQGET to achieve the functionality mentioned above


Use the PROPAGATE statement from a compute node to "call-return" to the MQGet node
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
nmaddisetti
PostPosted: Thu Mar 19, 2009 12:24 pm    Post subject: Reply with quote

Centurion

Joined: 06 Oct 2004
Posts: 145

Hi mgk,

I got the solution with your statement.

Thanks a lot.

Venkat.
Back to top
View user's profile Send private message
HOMETOWN47
PostPosted: Fri Mar 20, 2009 3:22 am    Post subject: Reply with quote

Apprentice

Joined: 25 Mar 2003
Posts: 34

Not too sure why you think that you'll get an infinite loop if you wire the Out terminal to the In terminal of the MQGet node.
My understanding is that you'll only get something on the Out terminal if the Get retrieved a message. Assuming that the number of messages on the queue is going to be low (as previous posts said that you're only expecting messages left because of exceptions) the Get is not going to consume CPU. If the Get is done by correlation Id then the 'no match' scenario will stop the loop back to the In terminal and processing will continue if the 'no message' terminal is wired to other nodes.

I stand to be correct but PLEASE provide explanantions why it's going to cause memory/CPU usage issues.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Mar 20, 2009 3:31 am    Post subject: Reply with quote

Grand High Poobah

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

HOMETOWN47 wrote:
I stand to be correct but PLEASE provide explanantions why it's going to cause memory/CPU usage issues.


Each instance of an MQGet node is its own thread and will sleep while the get waits to time out, causing paging and all sorts of bad things.

Especially if you have multiple instances of this flow all doing that.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
HOMETOWN47
PostPosted: Fri Mar 20, 2009 4:02 am    Post subject: Reply with quote

Apprentice

Joined: 25 Mar 2003
Posts: 34

Thanks for the information but still not sure why this is an issue.

Are you saying the issue with paging will be when there are multiple messages to get off the queue and each time the MQ Get is called (via the loop back) will mean a new instance of the node and hence a new thread ?

How is this different from using propagate to the MQGet node as suggested in earlier posts ?


Would appreciate further explanation on your answer as it's an interesting subject !
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Mar 20, 2009 4:11 am    Post subject: Reply with quote

Grand High Poobah

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

HOMETOWN47 wrote:
Would appreciate further explanation on your answer as it's an interesting subject !


I can put it no more eloquently than the discussion here.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
HOMETOWN47
PostPosted: Fri Mar 20, 2009 4:31 am    Post subject: Reply with quote

Apprentice

Joined: 25 Mar 2003
Posts: 34

Vitor, thanks for the link to the other post and I can see that if you were looping through 1000's of messages then memory issues are going to be a problem but having read the original posters email he's saying that he's only going to have 2 or 3 messages with the same correlation id on the queue.
I think that the loopback would work and not cause memory issues but also agree in hindsight that the PROPAGATE is the better solution and is more future proof i.e what if the number of messages on the queue increases, will this then cause memory issues.

An interesting topic.
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 » reading more than one message using MQGET
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.