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 » Message group processing on mqinput node

Post new topic  Reply to topic
 Message group processing on mqinput node « View previous topic :: View next topic » 
Author Message
zpat
PostPosted: Thu Aug 25, 2011 7:31 am    Post subject: Message group processing on mqinput node Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

WMQ 7, WMB 7, AIX

I have a group of messages on a MQ queue (using the MQMD.groupid field), it is marked complete when the last message in group flag is set.

Now, the MQinput node has the "All messages available" property which starts the flow when a complete MQ group is on the queue.

My question is if I want to read all the messages for a given group inside the flow - does the MQinput node repeatedly supply the same flow transaction with each message (like the fileinput node can do with records in a file).

Or is a new transaction started for each message in the group? Which would mean that I would have to use the MQGET node to get the remaining messages from the group inside the same transaction.

My requirement is to transform a group of MQ messages into a single file.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 25, 2011 7:36 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'd be tempted to string them through the MQInput node without using the group id, and then feed them to a Collector that does use GroupID.
Back to top
View user's profile Send private message
zpat
PostPosted: Thu Aug 25, 2011 9:22 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

OK, does that flow process all the messages in the group as part of a single transaction, or as one transaction per message?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 25, 2011 9:34 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

it would process each message in the group as an individual message going INTO collector, and then process them all as a single transaction coming OUT of collector.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Aug 26, 2011 12:25 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Does that mean that all the messages in the group are accumulated into memory and then propagated out as one item from the collector node when the group is complete?

The reason I ask is that the total size of all the messages is rather large.

I really want to process each message separately but inside one flow execution.

Another related question, can you send records to a fileoutput node and then finish file in another flow? I assume it has to be finished in the same flow execution?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Aug 26, 2011 1:21 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The collector node stores them on a Queue.
Well two queues actually.

The first is where the parts of the collection is stored.
The second holds complete collections that are waiting to be processed.

SYSTEM.BROKER.EDA.COLLECTIONS
SYSTEM.BROKER.EDA.EVENTS
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Aug 26, 2011 9:44 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

OK, but when it is complete - what happens - is it all read into memory at once?
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Aug 26, 2011 9:59 am    Post subject: Reply with quote

Grand High Poobah

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

zpat wrote:
is it all read into memory at once?




The collection is presented as a single message tree. The usual discussion about handling large messages applies.

But if you want them all in a single file I don't see a way round it - you can't (to answer your question from earlier) issue a Finish to a FileOutput node from a different flow.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Aug 26, 2011 12:57 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

There is an alternative - by using MQinput to get the first message when the group is ready, then propagating a MQget node from a compute node - multiple times to get the other messages in the group, and for each message propagate to the fileoutput node to accumulate the file data, and then finish file after the last message.

I just wanted to make sure that the collector node couldn't be used without the entire file being in memory (and it's rather large).
Back to top
View user's profile Send private message
Vitor
PostPosted: Sat Aug 27, 2011 4:19 am    Post subject: Reply with quote

Grand High Poobah

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

zpat wrote:
There is an alternative - by using MQinput to get the first message when the group is ready, then propagating a MQget node from a compute node - multiple times to get the other messages in the group, and for each message propagate to the fileoutput node to accumulate the file data, and then finish file after the last message.


It's certainly an option. You'd need to keep in mind the many discussions we've had about MQGet inside a loop causing memory problems, especially if you're going to be looping as many times as it seems.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sat Aug 27, 2011 5:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
zpat wrote:
There is an alternative - by using MQinput to get the first message when the group is ready, then propagating a MQget node from a compute node - multiple times to get the other messages in the group, and for each message propagate to the fileoutput node to accumulate the file data, and then finish file after the last message.


It's certainly an option. You'd need to keep in mind the many discussions we've had about MQGet inside a loop causing memory problems, especially if you're going to be looping as many times as it seems.


.

The first thing is to make sure you build the loop in the proper way...

The other thing to keep in mind is that, since you are trying to keep all of these messages in the same MQ transaction, that you then need to ensure that your Broker's qmgr logs have sufficient space for this transaction to occur - amongst all the rest of the transactions that are going on...

Secondly, I want to nit-pick at Vitor's answer about closing a file from a separate flow. It really depends on what you mean by "a separate flow"... You have to close the file using the finish file terminal on the same FileOutput node that has received all the input records... but that doesn't have to in any way have been invoked from the same input node that passed in all of the input records.

So you can, for example:
MQInput--(out)-------+->FileOutput
MQInput--(finishFile)-|

It's still the same .msgflow file, but it's an entirely separate instance of the message flow that can do or respond to entirely different and unrelated things.
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Aug 28, 2011 5:56 am    Post subject: Reply with quote

Grand High Poobah

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

mqjeff wrote:
Secondly, I want to nit-pick at Vitor's answer about closing a file from a separate flow. It really depends on what you mean by "a separate flow"... You have to close the file using the finish file terminal on the same FileOutput node that has received all the input records... but that doesn't have to in any way have been invoked from the same input node that passed in all of the input records.




It's a valid nit-pick. I stand by you can't close a file in Flow A from Flow B, but you could combine both functions into Flow A as my most worthy associate suggests.

FWIW faced with your scenario I'd use (and have used) a Collector node.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Message group processing on mqinput node
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.