|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL Code for batching messages based on MsgID |
« View previous topic :: View next topic » |
Author |
Message
|
AS283107 |
Posted: Mon Oct 03, 2016 12:16 am Post subject: ESQL Code for batching messages based on MsgID |
|
|
Newbie
Joined: 03 Oct 2016 Posts: 1
|
Hello,
Can someone pls help me to implement the below scenario.
Im getting individual messages as input, and i have to club these msgs based on the MessageID field value present in the input.
Ex : i got 10 msgs, its MessageID's are ABC,BCD.
Consider there are 6 msgs with MessageID = ABC, rest are belongs to BCD MessageID.
So the output should have two files, (one for ABC ID and other for BCD ID),
Each files should contain all the messages of same messageID.
Please help me on this |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Oct 03, 2016 12:31 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Can a moderator please move this to the Broker forum.
As to the subject of the post, having MSG_ID's the same (if you are referring to the MQMD.MSGID field) is a bad thing.
Can you please define what you mean by Message ID? Is it part of the message or what? _________________ 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 |
|
 |
Vitor |
Posted: Mon Oct 03, 2016 4:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
AS283107 wrote: |
Ex : i got 10 msgs, its MessageID's are ABC,BCD.
Consider there are 6 msgs with MessageID = ABC, rest are belongs to BCD MessageID. |
I agree with my worthy associate that MQ messages with the same MQ message id are bad. MQ Msg Ids set to string values are even worse.
If you want to group MQ messages together, how about giving them the same Group ID? It's intended for that ( the clue is in the name of the field) and you can then use the MQ facilities for handling groups of messages to batch them together.
AS283107 wrote: |
So the output should have two files, (one for ABC ID and other for BCD ID),
Each files should contain all the messages of same messageID. |
Assuming that messageID is in the payload of a non-MQ message, or that you're determined to stick with the suicidally crazy idea of treated an MQ MSgId as if it's a string and then putting multiply identical bits of business data in it, a Collector node would seem to be the way to go. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 03, 2016 5:06 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
From a pure algorithm point of view, to "group" things, you need to iterate over all of them and do something to put each element in it's own group.
ESQL does support a select statement, that will make this easier.
As you have been told twice already, and just for additional emphasis...
If you are sending more than one MQ Message with the same MsgId, this is not recommended practice. If only because any logging or monitoring you do won't be able to distinguish between messages without looking at the message body, which is more complicated and means you have to parse the data. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|