Author |
Message
|
phani_16 |
Posted: Thu Mar 10, 2011 5:46 am Post subject: Message Affinities |
|
|
Novice
Joined: 09 Mar 2011 Posts: 20
|
Hi,
I'm new to MQ and would like to implement/test the message affinity from MQI program in MQ clusters.
How do we actually achieve message affinities using MQI in clusters ? Is this achieved by grouping all the messages at once ?
If not,then for every MQOPEN and MQPUT call to a queue for a message,any same instance of the queue can be selected from the queue.
Do we have any sample MQI program for the same ? Please help me in this regard.
Thanks in advance. |
|
Back to top |
|
 |
mvic |
Posted: Thu Mar 10, 2011 6:00 am Post subject: Re: Message Affinities |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
phani_16 wrote: |
How do we actually achieve message affinities using MQI in clusters ? |
I would use bind-on-open. Please search for this and reply if anything is still uncertain.
Actually it would be a good idea to read the whole Queue Manager Clusters manual, to get a good background understanding. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 10, 2011 6:03 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Message affinity is bad.
You should design away from it.
When you open a QCLUSTER, you can choose what kind of BIND options you choose.
If, somehow, you have an incredibly specific and tight business requirement that absolutely requires that a set of messages is processed in order, then you should design this into the application that is processing the messages. Because it is a business requirement, and should therefore be handled at the application level rather than the transport level. |
|
Back to top |
|
 |
phani_16 |
Posted: Thu Mar 10, 2011 6:13 am Post subject: |
|
|
Novice
Joined: 09 Mar 2011 Posts: 20
|
Thanks very much for the prompt response.
I have read the queue managers cluster manual and its suggested that the best solution would be to define the default binding on the Queue to OPEN ( DEFBIND(OPEN) ) and then use BIND_AS_Q_DEF in the application.
If we use the BIND_ON_OPEN,then seems that multi-hop configuration is not best supported. ( Creating an ALIAS queue in the Queue manager ). |
|
Back to top |
|
 |
exerk |
Posted: Thu Mar 10, 2011 6:24 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
phani_16 wrote: |
...it's suggested that the best solution would be to define the default binding on the Queue to OPEN ( DEFBIND(OPEN) ) and then use BIND_AS_Q_DEF in the application... |
That is not the best method in my opinion, because it means no load balancing for those queues by other applications which have no affinity requirements. It is better to leave the queues as DEFBIND(NOTFIXED) and have the application specify BIND_ON_OPEN.
phani_16 wrote: |
...If we use the BIND_ON_OPEN,then seems that multi-hop configuration is not best supported. ( Creating an ALIAS queue in the Queue manager )... |
I think you're getting a little confused here between multi-hopping using 'vanilla' point-to-point (SDR/RCVR) channels, and load-balancing across a cluster. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
phani_16 |
Posted: Thu Mar 10, 2011 6:41 am Post subject: |
|
|
Novice
Joined: 09 Mar 2011 Posts: 20
|
If this is the case,then if i want to send first 5 messages to one instance of a queue in a cluster to one queue manager and then the next 5 messages to another queue manager, do we have to use to use grouping for these two sets of messages ?
or do we have to use cluster work load management attributes for queues,channels etc ? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 10, 2011 6:46 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
exerk wrote: |
phani_16 wrote: |
...it's suggested that the best solution would be to define the default binding on the Queue to OPEN ( DEFBIND(OPEN) ) and then use BIND_AS_Q_DEF in the application... |
That is not the best method in my opinion, because it means no load balancing for those queues by other applications which have no affinity requirements. It is better to leave the queues as DEFBIND(NOTFIXED) and have the application specify BIND_ON_OPEN. |
It's better to have all applications completely ignore DEFBIND.
exerk wrote: |
phani_16 wrote: |
...If we use the BIND_ON_OPEN,then seems that multi-hop configuration is not best supported. ( Creating an ALIAS queue in the Queue manager )... |
I think you're getting a little confused here between multi-hopping using 'vanilla' point-to-point (SDR/RCVR) channels, and load-balancing across a cluster. |
It is technically possible to configure multi-hopping with clustering. But not usually with just one cluster.
Within a cluster, all traffic is point to point from sending app to receiving app, unless you take a lot of effort with qaliases and qremotes to make it go the long way around. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Mar 10, 2011 1:19 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
phani_16 wrote: |
If this is the case,then if i want to send first 5 messages to one instance of a queue in a cluster to one queue manager and then the next 5 messages to another queue manager, do we have to use to use grouping for these two sets of messages ?
or do we have to use cluster work load management attributes for queues,channels etc ? |
Neither nor...
You use default bind on open for each group and you close between groups.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Mar 10, 2011 1:40 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
The WMQ Cluster Queue Manager manual describes the basic round-robin method queues are selected.
At the applications first MQOPEN WITH MQOO_BIND_ON_OPEN, one instance of the cluster queue will be selected.
After your app puts 5 messages, close the queue; then MQOPEN the queue again with MQOO_BIND_ON_OPEN. The clustering software will then select the next instance of the queue; then put the next 5 messages. Repeat. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Mar 10, 2011 5:01 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
bruce2359 wrote: |
After your app puts 5 messages, close the queue; then MQOPEN the queue again with MQOO_BIND_ON_OPEN. The clustering software will then select the next instance of the queue; then put the next 5 messages. Repeat. |
And when the cluster selects the next instance of the queue to put the next 5 messages, there is nothing preventing it from deciding that the same queue the previous 5 went to is the best choice according to the rules of the cluster workload algorithm. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Mar 10, 2011 7:18 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
True.
You can have some influence on the distribution of msgs, but
You can't force distribution of msgs with clustering software.
Read the manual for an explanation of the routing algorithm. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
phani_16 |
Posted: Mon Mar 14, 2011 1:27 am Post subject: |
|
|
Novice
Joined: 09 Mar 2011 Posts: 20
|
Thanks all for the descriptive answers. |
|
Back to top |
|
 |
|