Author |
Message
|
MQEnthu |
Posted: Wed Apr 22, 2015 4:52 am Post subject: Message re-grouping in broker |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Hi,
I am receiving a segmented messages from application on to my input queue of a flow. It is XML message and split message do not form a valid xml. I would want to have them grouped and form a single message and then process it in flow.
I have set the Group related properties (Logical Order, All messages available and Commit by message group). But no luck.
Wanted to know if we can achieve this in broker flow? Please suggest.
Thank you  _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 22, 2015 5:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Depending on how big the actual XML is, have you thought about using a collection node? This way you could assemble the full XML before processing it...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 22, 2015 5:07 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Broker only supports Grouped messages, not Segmented messages.
You can investigate the options to automatically assemble segmented messages by the queue manager.
Or you can use some method of collecting the individual segments and assembling the contents into a single bitstream and then parsing that. |
|
Back to top |
|
 |
MQEnthu |
Posted: Wed Apr 22, 2015 5:13 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Quote: |
Broker only supports Grouped messages, not Segmented messages. |
Sorry!! It is grouped messages only. Still not working . I want to consume it as whole one message in broker flow _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Apr 22, 2015 5:15 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Ok, so it is not working.
What is not working? Please explain otherise we can't even begin to help _________________ 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 |
|
 |
zpat |
Posted: Wed Apr 22, 2015 5:31 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Possibly you don't understand how grouped messages work.
When generated the "message in group" flag is set on each one (and the same groupid value). On the final one the "last in group" is flag set.
On WMB MQ input node the "all messages available" check box needs to be ticked. This instructs MQ to only supply the first message in the group when the entire group is on the queue.
The message flow will be presented with the first message in group, and the flow will run to completion. It will then be presented with the next in group and so on.
If the message flow needs to take some action such as to accumulate the messages together - that has to be done in the flow - for example you might pass each message to a file output node.
The flow can detect the last message in group by examining the MQMD message flags and then can optionally choose to perform any final actions (such as finalising the file).
So you can do whatever you want - but this is not some magical group assembly of message data into one huge message. It is passing your flow each message in the group, one at a time.
Your flow logic has to do any assembly required (watch out for memory use). _________________ 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 |
|
 |
MQEnthu |
Posted: Wed Apr 22, 2015 5:48 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
zpat wrote: |
Your flow logic has to do any assembly required (watch out for memory use). |
Thanks for clarification. I was thinking the assembling/merging would happens by itself with some settings. By enabling some MQGMO options  _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
zpat |
Posted: Wed Apr 22, 2015 7:43 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
To detect the last message
Code: |
IF (InputRoot.MQMD.MsgFlags = MQMF_LAST_MSG_IN_GROUP + MQMF_MSG_IN_GROUP) OR
(InputRoot.MQMD.MsgFlags = MQMF_LAST_MSG_IN_GROUP) THEN
PROPAGATE TO TERMINAL 'out' FINALIZE NONE DELETE NONE; /* SEND LAST MESSAGE TO DOWNSTREAM NODES */
PROPAGATE TO TERMINAL 'out1'; /* PERFORM FINAL ACTIONS IF ANY */
RETURN FALSE;
END IF; |
_________________ 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 |
|
 |
MQEnthu |
Posted: Wed Apr 22, 2015 8:14 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Thanks..
As first approach, I will try to ask sending application not to split messages and try to have less number of records in each message to reduce the message size.
If that is not possible I will try to handle it in broker _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
|