ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Round Robbin algorithm implementation in esql

Post new topic  Reply to topic
 Round Robbin algorithm implementation in esql « View previous topic :: View next topic » 
Author Message
Morphy
PostPosted: Fri Dec 16, 2016 9:01 pm    Post subject: Round Robbin algorithm implementation in esql Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Fri Dec 16, 2016 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Dec 21, 2016 5:50 am    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Wed Dec 21, 2016 7:04 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Dec 21, 2016 8:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Round Robbin algorithm implementation in esql
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.