|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Round Robbin algorithm implementation in esql |
« View previous topic :: View next topic » |
Author |
Message
|
Morphy |
Posted: Fri Dec 16, 2016 9:01 pm Post subject: Round Robbin algorithm implementation in esql |
|
|
 Newbie
Joined: 08 Dec 2016 Posts: 5
|
Hi Guys,
I have a scenario to implement Round Robbin algorithm in message flow.My message flow is like this.
MQInputNode >ComputeNode > MQOUtputNode
I will receive a bulk of messages, which I want to sent first 4 messages to 4 different Queues(A1,A2,A3,A4) and another 4 messages to 4 different queues(B1,B2,B3,B4), upto D1--D4 queues.
Now the loop should repeat and again 4 messages should be sent to (A1,A2,A3,A4).... and another 4 messages to (B1,B2,B3,B4) queues like that.... so on it continues. How to implement this logic in esql. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Dec 16, 2016 11:55 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
You can keep track of the last queue used by using a counter in a shared variable.
This will be good unless you (or some PHB) decides that multiple instances of the flow will be needed.
Look up ESQL shared variables in the documentation. _________________ 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 |
|
 |
mqjeff |
Posted: Wed Dec 21, 2016 5:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
MQ will handle this for you.
Put any message A to one cluster queue.
Put any message B to another cluster queue. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Dec 21, 2016 7:04 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
mqjeff wrote: |
MQ will handle this for you.
Put any message A to one cluster queue.
Put any message B to another cluster queue. |
Two points
1) The Original Post did not mention MQ Clusters
2) You still have to decide which queue/queues to put the message to. How can MQ decide that if Clustering is not involved? AFAIK, this is why the OP mentioned ESQL. _________________ 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 |
|
 |
mqjeff |
Posted: Wed Dec 21, 2016 8:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
smdavies99 wrote: |
mqjeff wrote: |
MQ will handle this for you.
Put any message A to one cluster queue.
Put any message B to another cluster queue. |
Two points
1) The Original Post did not mention MQ Clusters
2) You still have to decide which queue/queues to put the message to. How can MQ decide that if Clustering is not involved? AFAIK, this is why the OP mentioned ESQL. |
MQ will put the message to the queue named in the MQOutput.
If that happens to be a clustered queue, it will round robin the message.
If the OP wants to round robin the messages, then a clustered queue will do the job.
If the OP wants to round robin message A1 across a different queue than A2, well. A different clustered queue will do the job also.
If the OP really really wants to implement their own round-robin algorithm, then the thoughts you've given will probably help. And the difficulties you mentioned will also probably help.
Clustered queues are a lot easier, and not subject to issues with scaling. For most values of 'round robin'. For extremely precise values, there's a lot more work that has to be done...
Using ESQL is the hard way to do this. _________________ 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
|
|
|
|