Author |
Message
|
mikivin |
Posted: Sun May 28, 2006 3:29 am Post subject: Design problem - message flow |
|
|
Novice
Joined: 06 Apr 2006 Posts: 10
|
Hi,
I'm using WMB 6.I have design problem.
I should get some number of messages according one request.One message say that he is last. I should collect all messages and redirect them to another queue when last message arrive.
My question is:
1.How I should design flow ?
1.If I can read/write some messages in one JavaNode(if yes - how ?).
Thanks in advance.
Miki |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun May 28, 2006 5:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The only way to get more than one MQ message in a flow is to use both an MQInput and the MQGet node.
Or to use a Java compute node and rewrite the functionality of the MQGet node in Java using the MQ API. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Sun May 28, 2006 1:20 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
You can also introduce a database to store the messages leading up to the final one. |
|
Back to top |
|
 |
pottas |
Posted: Sun May 28, 2006 11:29 pm Post subject: |
|
|
 Disciple
Joined: 27 Oct 2005 Posts: 185 Location: South Africa
|
We deal with a lot of group messages - and as JT states, we use the database to store the messages.
In principle, this is our design:
Subflow - 'Combine_Group_Messages':
Input --> Compute:'LogToTable' --> Compute:'CombineMsgs' --> Output
Compute:'LogToTable':
1. Copy Entire Message
2. If InputRoot.MQMD.MsgFlags <> 0 then insert message into database
Compute:'CombineMsgs':
1. Copy Entire Message
2. If InputRoot.MQMD.MsgFlags = 24 then
Get the message from the database
build message as blob
return TRUE
else
If InputRoot.MQMD.MsgFlags = 0
return TRUE
else
return FALSE
end if
end if
Hope this gives you at least an idea how to handle it. |
|
Back to top |
|
 |
elvis_gn |
Posted: Sun May 28, 2006 11:57 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi mikivin,
How will you identify that a message is last...? Will it be in the Body of the message...
You could connect your MQGet to a Filter node and check if the request message is the last....if not, add it to the body or do whatever you need to do with it and then loop back to the same MQGet node for the next message...until the Filter node identifies that the last message has been picked and the resultant message should now be put into another queue....
You might need identification of different sets of request messages by their correlationId or so, IF you have totally independant request message sets coming at the same time....
Regards. |
|
Back to top |
|
 |
mikivin |
Posted: Mon May 29, 2006 1:04 am Post subject: |
|
|
Novice
Joined: 06 Apr 2006 Posts: 10
|
What about perfomance ? What quantity messages You deal with ? How many messages per second ?
pottas wrote: |
We deal with a lot of group messages - and as JT states, we use the database to store the messages.
In principle, this is our design:
Subflow - 'Combine_Group_Messages':
Input --> Compute:'LogToTable' --> Compute:'CombineMsgs' --> Output
Compute:'LogToTable':
1. Copy Entire Message
2. If InputRoot.MQMD.MsgFlags <> 0 then insert message into database
Compute:'CombineMsgs':
1. Copy Entire Message
2. If InputRoot.MQMD.MsgFlags = 24 then
Get the message from the database
build message as blob
return TRUE
else
If InputRoot.MQMD.MsgFlags = 0
return TRUE
else
return FALSE
end if
end if
Hope this gives you at least an idea how to handle it. |
|
|
Back to top |
|
 |
pottas |
Posted: Mon May 29, 2006 2:28 am Post subject: |
|
|
 Disciple
Joined: 27 Oct 2005 Posts: 185 Location: South Africa
|
mikivin,
Very good question... You see, we're not really too much concerned about the performance, we simply combine the group messages in our hub and then re-format it into a specific message format and then get it to the customer queues. So to be honest, we never designed the flows for optimum performance.
If that is of importance in your flows, then I suggest you look at other options, like jefflowrey's:
Quote: |
The only way to get more than one MQ message in a flow is to use both an MQInput and the MQGet node.
Or to use a Java compute node and rewrite the functionality of the MQGet node in Java using the MQ API.
|
...but if your consideration is merely combining the group messages and performance is not an issue, I would gladly post you some more details on how we handle it.
Good luck!
pottas |
|
Back to top |
|
 |
mikivin |
Posted: Sun Jun 04, 2006 3:02 am Post subject: |
|
|
Novice
Joined: 06 Apr 2006 Posts: 10
|
Thanks to all. We decide to do it with Java |
|
Back to top |
|
 |
|