Author |
Message
|
sunny_30 |
Posted: Sat Mar 03, 2007 8:06 pm Post subject: Message Grouping by Broker 6.0 |
|
|
 Master
Joined: 03 Oct 2005 Posts: 258
|
Hi Guys,
I need your help here. I built a message-flow to process a bunch of individual MQ messages sequentially and write them as MQ segmented messages to the MQ output. I have the RFH2 header coming in on each of the MQ messages that determines which one is the first part & which one is the last part.
Broker did the application segmenting here (using the compute node) by setting the length, offset & segment/last-segment parts of each MQ message. This part is working fine.
But now we realised that the end application is unable to pick up the segmented messages as a complete message, but rather it can only read the logical group messages as a single message.
So my question now is:
Using the Broker can I be able to process these individual MQ messages coming in, to convert them to a logical MQ group messages? / Can I convert these segmented messages to Group messages / Can I set the Logical order for each message from the compute or the output nodes of the flow?
Thanks in advance and waiting for your valuable responses.
-Sunny. |
|
Back to top |
|
 |
sunny_30 |
Posted: Wed Mar 07, 2007 11:11 am Post subject: |
|
|
 Master
Joined: 03 Oct 2005 Posts: 258
|
Can anyone please help?
Sorry if I was not clear in my earlier post. I will reframe my question so I can make things more clear...
Using a message-flow, Can I read a sequence of mq-messages that are not part of a group & write it as a message-group to the output queue.
I was successful in creating a group-of-segments to the output, but I am trying to figure out a way to create a group of logically-ordered-messages to the output.
For each of the individual mq-messages passing through the flow, I have to be able to set the MQPMO_LOGICAL_ORDER and MQMF_MSG_IN_GROUP/MQMF_LAST_MSG_IN_GROUP in the MQMD. That way I can read the bunch of messages outputted as a single group.
Please suggest if this task can be done.
Thanks in advance. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 08, 2007 5:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If the messages arrive out of order, you can't assume you can send any of them until you've assembled the whole set.
If, however, the messages arrive with some home-grown version of message sequence number, then you can map that to the group sequence number.
Generally, yes, you can process an ungrouped set of input messages into a grouped set of output messages. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sunny_30 |
Posted: Thu Mar 08, 2007 9:03 am Post subject: |
|
|
 Master
Joined: 03 Oct 2005 Posts: 258
|
Hi Jeff,
Thanks for you reply.
All the messages that I read arrive with a RFH2 header on top of it. Looking at the RFH2 I will know which one is the first & which one is the last message. The sequence is also maintained here.
The messages arrive one after the other in sequence only after I process each one & send back a reply to the sending-application. So sequence is not a problem.
I am on MB version 6.0; I will be able to generate a random Group_Id to the first message, store it into a shared-variable and assign the same to all the messages in the group that follow( i.e to OutputRoot.MQMD.GroupId of each message) and output.
I am also able to set the MQMF_MSG_IN_GROUP/MQMF_LAST_MSG_IN_GROUP to the OutputRoot.MQMD.MsgFlags field of each message.
Here is where I am stuck. I am not understanding how to generate a logical-sequence to each message. To what entity of the MQMD do I assign the MQPMO_LOGICAL_ORDER. Where do I incorporate the logical-sequence to the group-messages that I output by the message-flow.
For now, I have a message-flow that processes the incoming set of mq-messages & output as the segmented group. Using RFHUtil I can read the set of segmented output messages as one single message. But the problem after I did all this was that the end-application is only configured to read the group-messages but not the segmented-messages.
So the requirement now is: I shd be either be able to process the incoming set to convert to a logical group (or) build another flow to convert segmented to the logical-group.
I am trying to figure out on how. Is there really a way to do this by a flow rather than using a C-program to read each message & convert it to a group.
Thanks
Sunny |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 09, 2007 4:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
MQPMO options are usually made available in the properties of the MQOutput node.
So what should be required is to fill out the fields of the MQMD to indicate that a) this is a message in a group, b) which number in the group this is, and c) if this is the last message. Then set the options on the MQOutput node to indicate that you're sending grouped messages. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sunny_30 |
Posted: Fri Mar 09, 2007 7:24 am Post subject: |
|
|
 Master
Joined: 03 Oct 2005 Posts: 258
|
Thanks for your reply.
Quote: |
So what should be required is to fill out the fields of the MQMD to indicate that
a) this is a message in a group, |
This part is fine.
I am able to set 'MQMF_MSG_IN_GROUP' to the MQMD.MsgFlags field of the message.
Quote: |
b) which number in the group this is, and |
I am not sure if what field of the MQMD would carry the logical-seq number. I guess when the MQPMO_LOGICAL_ORDER option is set by the Output node (if possible) then the sequence number for each MQ-message will be taken care of automatically.
Quote: |
c) if this is the last message. |
This part is also fine.
I am able to set 'MQMF_LAST_MSG_IN_GROUP' to the MQMD.MsgFlags field of the last group message.
Quote: |
Then set the options on the MQOutput node to indicate that you're sending grouped messages. |
I am not seeing any option in the Output to indicate the MQPMO_LOGICAL_ORDER option.
So my guess would be that a Broker flow can only create a segmented-group of messages, but not the logical-group of messages.
please advise.
-Sunny |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 09, 2007 7:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay, you don't need to specify MQPMO_LOGICAL_ORDER. It's a convenience option, allowing the qmgr to specify the MsgSeqNumber, GroupId and Offset MQMD fields rather than forcing you to do so yourself.
For strictly logical groups, you do not need to set Offset. You just need to set GroupId and MsgSeqNumber. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sunny_30 |
Posted: Sat Mar 10, 2007 10:04 am Post subject: |
|
|
 Master
Joined: 03 Oct 2005 Posts: 258
|
Thanks Jeff. It worked without specifying the MQPMO_LOGICAL_ORDER.
Before, I was missing the MQMD.MsgSeqNumber field.
Just populated the same GroupId (using shared variables in Broker 6.0), the MsgSeqNumber & the MsgFlags fields of the MQMD and the logical-group messages were created. |
|
Back to top |
|
 |
|