Author |
Message
|
telesguilherme |
Posted: Mon Nov 04, 2013 5:28 am Post subject: MQGET Load Balance |
|
|
Acolyte
Joined: 16 Feb 2008 Posts: 56
|
Dear All,
How MQGET can retrieve a message from a remote queue ? I mean, in the manual of queue manager cluster its said that an MQPUT can PUT messages in the Load Balance/Any Queue, but the MQGET command, can only GET messages from the Local Queue.
My point is, if, in the load balance architecture, the MQPUT message was is in the remote queue (server2), and the MQGET goes to the server1, how can it be found ? |
|
Back to top |
|
 |
rammer |
Posted: Mon Nov 04, 2013 6:02 am Post subject: |
|
|
Partisan
Joined: 02 May 2002 Posts: 359 Location: England
|
You need to run the application local on Server 2, carrying out a GET from the Local Queue. Or have a Client connection into Server 2 carrying out a GET from the Local Queue on Server 2. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 04, 2013 6:39 am Post subject: Re: MQGET Load Balance |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
telesguilherme wrote: |
My point is, if, in the load balance architecture, the MQPUT message was is in the remote queue (server2), and the MQGET goes to the server1, how can it be found ? |
If the application doing the put sending a request then the ReplyTo queue manager field will identify which queue manager in the cluster the reponse should be sent to. If the responding application doesn't honour that and just dumps the reply into the cluster then your design is at fault and:
a) the reponding application needs to be changed to send the message correctly
or
b) the content of response needs to be such that it can be processed by any of the possible getting applications, not just the original sender. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
telesguilherme |
Posted: Mon Nov 04, 2013 8:18 am Post subject: |
|
|
Acolyte
Joined: 16 Feb 2008 Posts: 56
|
Rammer,
First of all, my apologies. Both servers, server1 and server2, are running the applications (backend servers), and have the same queues shared.
Vitor,
I understand. But my problem, is that the application in that case return messages to an example queue, and expect an outside application to collect data on that queue. Just to clarify, i have 2 queue managers in the cluster (load balance).
My doubt is about the GET command as it say in the MQ manual - Queue manager cluster:
"As with distributed queuing, an application uses the MQPUT call to put a message on a cluster queue at any queue manager. An application uses the MQGET call to retrieve messages from a cluster queue on the local queue manager."
and
"You can only GET from a local cluster queue, but you can PUT to any queue in a cluster. If you open a queue to use the MQGET command, the queue manager will only use the local queue."
My point is that, if the GET reaches a queue on server2 that dont have the data, and another queue on server1 has, how can the application handle this ?
I will have to do either of the suggestions ?
a) the reponding application needs to be changed to send the message correctly
or
b) the content of response needs to be such that it can be processed by any of the possible getting applications, not just the original sender. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 04, 2013 8:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
telesguilherme wrote: |
my problem, is that the application in that case return messages to an example queue, and expect an outside application to collect data on that queue. |
Which is the situation I outline above; the application is not responding to the sending application, it's simply putting the message to what you describe as an example queue (which is an odd term).
So if they don't use any of the original MQMD values, you're right - the message could end up on a server different to the one that sent the original message. I stand by my comment that your design is hosed, in that it assumes only one queue manager is in use.
So:
telesguilherme wrote: |
I will have to do either of the suggestions ? |
Yes. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
telesguilherme |
Posted: Mon Nov 04, 2013 8:33 am Post subject: |
|
|
Acolyte
Joined: 16 Feb 2008 Posts: 56
|
Vitor,
But, what will be the objective of the load balance if we are "stopped" in only one server and queue? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 04, 2013 8:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
telesguilherme wrote: |
But, what will be the objective of the load balance if we are "stopped" in only one server and queue? |
Define "stopped".
Also define what objective you mean (or expect from) "load balancing".
If you're trying to balance load across 2 servers because you have a lot of messages ("load") to process quickly.
If you're trying to balance load across 2 servers because you want messages to continue to flow even if one server stops, then a cluster is the wrong architecture to use. You should use MI or some other HA solution, which a WMQ cluster is not.
Likewise, if you can't handle the load with only one server and want to know what to do if one server fails, you need to be thinking MI or HA.
These are concepts called "design" and "planning". No-one here (including me) can know all the aspects of your requirements and site; only you know that. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
telesguilherme |
Posted: Mon Nov 04, 2013 9:00 am Post subject: |
|
|
Acolyte
Joined: 16 Feb 2008 Posts: 56
|
Vitor,
When a mean "stopped", i mean with this approach of my actual architecture, the message will be like stuck, no out of a queue in particulary.
My goal is to use queue manager cluster to increased availability and workload balancing due to the ability to define instances of the same queue
on multiple queue managers in the cluster and distribute messages to those queues.
When i was reading the redbooks i got this about load balacing:
"When a cluster contains more than one instance of
the same queue, workload balancing determines
the best queue manager to route a message to."
Its wrong ? i need to use another architecture ? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 04, 2013 9:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
telesguilherme wrote: |
Its wrong ? i need to use another architecture ? |
Yes. What you're describing is high availability (HA). The redbook is correct in that if you have a lot of messages ("load") then messages are distributed. This is the wrong architecture to deal with the situation where one server is out of action & you want messages routed away from it. There are a number of discussions in here on this you can look up and it's possible to use a cluster in this way but you have to face a number of problems starting with the one you've yourself identified.
You're much better off using MI or another HA solution to increase availability. If you want to combine that with workload balancing across a number of servers to increase throughput (rather than availability) then that's fine. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
telesguilherme |
Posted: Mon Nov 04, 2013 9:15 am Post subject: |
|
|
Acolyte
Joined: 16 Feb 2008 Posts: 56
|
Vitor,
What if i use my actual architecture with MI. The problem with the data on any queue, generated by my inside applications (On Websphere Message Broker) will remain ?
I mean, the fear on my head is that the messages will be left alone and not reached by MQGET on a remote queue, IF the MQGET but an outside application goes to server1 for example instead of server2. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 04, 2013 9:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
telesguilherme wrote: |
What if i use my actual architecture with MI. The problem with the data on any queue, generated by my inside applications (On Websphere Message Broker) will remain ? |
Of course it will. You're not doing anything to address the problem (pun intended)
telesguilherme wrote: |
I mean, the fear on my head is that the messages will be left alone and not reached by MQGET on a remote queue, IF the MQGET but an outside application goes to server1 for example instead of server2. |
You need to think very clearly and stop just reacting in fear by pulling out terms. You need to think about your application design and what you want to achieve, both with the applications and with the architecture.
Bottom line - you can't do an MQGet on any queue which is not local to the queue manager to which the application is connected. Faced with this fact, you need to arrange your architecture and application design accordingly.
Enjoy. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Nov 04, 2013 9:51 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 04, 2013 9:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
http://www.ibm.com/developerworks/websphere/library/techarticles/1303_broadhurst/1303_broadhurst.html |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
telesguilherme |
Posted: Wed Nov 06, 2013 5:45 am Post subject: |
|
|
Acolyte
Joined: 16 Feb 2008 Posts: 56
|
This article is very good.
My last doubt is about the behavior of queues within a cluster.
For my environment.
two mq servers, mq1 and mq2, QM1 and QM2.
I have queueA on QM1 and queueA (same name) on QM2. How they comunicate if a Broker application puts data from mq2 on queueA ? That data will be replicated ? |
|
Back to top |
|
 |
JosephGramig |
Posted: Wed Nov 06, 2013 5:54 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
No. The Qmgr's cluster load balancer will pick one of the queues and send it to that one queue. Did you specify DEFBIND(NOTFIXED) on both cluster queues? If not, it is unlikely you will get load balancing.
So, your brokers should have identical deployments so they can process the request at either broker as this seems to be what you are attempting.
In this case, the broker is providing a service you are making more available (which is not the same as highly available). One of the brokers could be stopped and msgs will still get sent to both Qmgrs as the Qmgrs are not taking anything about the brokers into account for load balancing. |
|
Back to top |
|
 |
|