Author |
Message
|
mq_crazy |
Posted: Tue Aug 09, 2005 11:36 am Post subject: |
|
|
 Master
Joined: 30 Jun 2004 Posts: 295
|
One way to do this is create a remote queue defintion on the QM2 like this
DEFINE QREMOTE(xxxx) RQMNAME(QM3)
and in the remote queue definition that you created on QM1 change the RQMNAME parameter from QM2 to this xxxx.
It should work and i have tested it. |
|
Back to top |
|
 |
andrey81inmd |
Posted: Tue Aug 09, 2005 11:40 am Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
wschutz wrote: |
So then I'd recommend you look at the MQ Cluster's book, chapter 4 "Putting from a Queue Manager outside the cluster- alternative" for the definitions to use.... |
Where would I get this book? |
|
Back to top |
|
 |
mq_crazy |
Posted: Tue Aug 09, 2005 11:42 am Post subject: |
|
|
 Master
Joined: 30 Jun 2004 Posts: 295
|
|
Back to top |
|
 |
Nigelg |
Posted: Wed Aug 10, 2005 12:12 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
You do not need a remote queue definition at all. When your app calls MQOPEN, put the qm alias name in the ObjectQMgrName field of the MQOD structure. _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
andrey81inmd |
Posted: Wed Aug 10, 2005 6:13 am Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
Nigelg wrote: |
You do not need a remote queue definition at all. When your app calls MQOPEN, put the qm alias name in the ObjectQMgrName field of the MQOD structure. |
I dont know why, but MQ documentation on Java API seems to be really difficult to find. I know how to open a queue using JMS API, but that doesn't have an MQOPEN method in any of the classes. How do I use the native API to open a queue? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 10, 2005 6:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
andrey81inmd wrote: |
I dont know why, but MQ documentation on Java API seems to be really difficult to find. |
Using Java _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
andrey81inmd |
Posted: Thu Aug 11, 2005 4:40 am Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
Nigelg wrote: |
You do not need a remote queue definition at all. When your app calls MQOPEN, put the qm alias name in the ObjectQMgrName field of the MQOD structure. |
I did this, and it works only for local queues. Since MyQueue is a cluster queue, it again gives me an error.
IMO, this is a design flaw. Cluster queues and local queues should look exactly the same to the program as far as putting messages goes (obviously you cant get a message from a cluster queue). |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 11, 2005 4:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
andrey81inmd wrote: |
Cluster queues and local queues should look exactly the same to the program as far as putting messages goes (obviously you cant get a message from a cluster queue). |
In my experience, this is true.
Have you looked at the MQ sample code on IBM's website? There are some JMS examples that should work just fine regardless of the nature of the queue that is being put to. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Nigelg |
Posted: Thu Aug 11, 2005 5:16 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Quote: |
I did this, and it works only for local queues. Since MyQueue is a cluster queue, it again gives me an error.
|
You did not do it properly; it does work.
My setup:
qmgr DNT33, a PR in cluster CL1, hosts a queue REPLYQ not shared in any cluster
qmgr DUX10 is a FR in CL1 and CL2, with a qmgr alias DNT33R pointing to DNT33, shared in CL1
qmgr MQDA is a PR in CL2
The command
amqsput REPLYQ MQDA 40976 0 DNT33R
executed on qmgr MQDA routes the msg to REPLYQ on DNT33, even though the putting qmgr is in a different cluster.
Before suggesting that there is a design flaw, try investigating a bit more deeply.[/quote] _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Aug 11, 2005 11:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You can use a qmgr alias for the cluster known to the cluster:
Code: |
def qr(mycluster) rqmname(' ') cluster(mycluster) |
Notice that all messages addressed to the cluster must find a default way to hit a qmgr in the cluster.
Upon hitting the cluster the cluster qmgr name resolves to blank and cluster resolution will be used as well as round robin and workload balancing ...
Enjoy  |
|
Back to top |
|
 |
andrey81inmd |
Posted: Thu Aug 11, 2005 12:59 pm Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
Nigelg wrote: |
Quote: |
I did this, and it works only for local queues. Since MyQueue is a cluster queue, it again gives me an error.
|
You did not do it properly; it does work.
My setup:
qmgr DNT33, a PR in cluster CL1, hosts a queue REPLYQ not shared in any cluster
qmgr DUX10 is a FR in CL1 and CL2, with a qmgr alias DNT33R pointing to DNT33, shared in CL1
qmgr MQDA is a PR in CL2
The command
amqsput REPLYQ MQDA 40976 0 DNT33R
executed on qmgr MQDA routes the msg to REPLYQ on DNT33, even though the putting qmgr is in a different cluster.
|
But REPLYQ is a local queue on DNT33. This does work. Would this work if you had another qmgr DNT44, which was in CL1? Suppose DNT44 hosts REPLYQ and shares it in CL1. So it would show up as a cluster queue in DNT33. Would the same exact command work? It does not work for me.
Nigelg wrote: |
Before suggesting that there is a design flaw, try investigating a bit more deeply. |
We placed a service call with IBM. Two days later they called us back saying their setup reproduces the same problem. If it's not a design flaw, then I guess IBM doesn't know how to use their own software  |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Aug 12, 2005 4:59 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I have no idea why in the world the service center could not get this to work. This is pretty simple.
It does not matter what machines these QMs are on. At all. So don't worry about that.
Assumptions:
MyQueue lives on QM3.
MyQueue is clustered to CLUSTERA.
QM2 and QM3 are in CLUSTERA.
Your putting app is connected to QM1.
QM1 is not in CLUSTERA.
You want to do a put on QM1 that will get a message to MyQueue on QM3.
You want the message to go from QM1 to QM2 to MyQueue on QM3.
You want do do this put so that the putting app on QM1 does not have to specify the destination QM, because that destination QM name will change as you roll your code through DEV to QA to PROD.
If all the above is true, then answer just one question, and I will give you the MQ object definition(s) that you need to create on QM1 to make this work. The one question is:
How do you have QM1 and QM2 connected? Is there a regular XMITQ on QM1 feeding a regular SNDR channel to QM2? Or are QM2 and QM3 in CLUSTERA and QM1 and QM2 are in CLUSTERB, and QM2 is a member of of both overlapping clusters?
There is no design flaw in MQ. This works just fine regardless of the answer to the one question above. I have hundreds of queues using both scenarios. You just don't have your MQ objects defined correctly yet. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
ascheman |
Posted: Thu Jan 17, 2008 5:09 am Post subject: Cluster QM alias (Re: Setting up a QM alias) |
|
|
 Newbie
Joined: 04 Jan 2008 Posts: 2
|
Hi,
I was running into a similar problem: I have a cluster, say MYCLS consisting of several QueueManagers, e.g., CL1, CL2 etc. On each (or at least some of them, the so-called gateway QMs) I wanted to have an QM alias "MYCLS" to enable addressing the Cluster instead of a particular QM. I set up the alias by "define qr(MYCLS) rname(' ') rqmname(' ')". This does literaly mean: "If a message arrives for this 'aliased' QM just replace the remote QM by ' ', i.e., the local/Cluster QM and leave the Queue name in place". Hence it is left to the cluster to find the addressed Queue (from the message) and deliver the message to one of the respective local (Cluster) Queues according to other rules (priority, operative state, load, ...).
However I was not able to send in a message over a client connection (from Java by putting the QM name "MYCLS" as first argument to the QueueManager-Constructor): I got the 2058 error. Everything worked fine if I used the internal alias value (" ") directly as a QM name parameter to the constructor. It's just like replacing the first indirection myself as I would expect it from the QM like described above.
But when I set up another Queue Manager which is remote to my cluster (and having channels and everything else to connect it to the cluster), I can use "MYCLS" as QM name: "def qremote(my.sndq) xmitq(...) rname(xxx) rqmname(MYCLS)" and can happily send messages over this remote queue.
Should I consider this as bug in MQ (I am using MQ 6.0.2.0 on Solaris 10).
Regs,
Gerd
andrey81inmd wrote: |
Hello,
I have two QM's on my Windows machine, QM1 and QM2. QM1 is the default QM. In my Java code, I need to put a message on a cluster queue, call it MyQueue, which is located in QM2. I need to do this without specifying the name of the queue manager (because we need to deploy this code on several servers in a clustered environment, where the queue names will be the same, but queue managers will be different).
In this document: http://publibfp.boulder.ibm.com/epubs/pdf/csqzae07.pdf
on page 26, it says how to create a QM alias:
DEFINE QREMOTE(CommonQM) RQMNAME(QM2)
This creates a "remote queue definition", which is supposed to act as a QM alias, i.e. according to the document, I can send a message to the queue MyQueue on QM CommonQM (even though CommonQM is inside QM1? that doesn't make much sense to me as far as MQ design).
Unfortunately, this doesnt seem to work. I tried the following commands:
amqsput MyQueue CommonQM
Sample AMQSPUT0 start
MQCONN ended with reason code 2058
amqsput CommonQM
Sample AMQSPUT0 start
target queue is CommonQM
MQOPEN ended with reason code 2184
unable to open queue for output
Sample AMQSPUT0 end
What am I doing wrong?
Thanks.
Andrey |
|
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 17, 2008 6:33 am Post subject: Re: Cluster QM alias (Re: Setting up a QM alias) |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ascheman wrote: |
Should I consider this as bug in MQ (I am using MQ 6.0.2.0 on Solaris 10).
|
No, working as designed. A client will always connect to a given queue manager, never to a cluster. It's possible (using a blank queue manager name) to make the client select the first available queue manager from a list but it will never connect to a queue manager alias.
These are used for message routing, so one queue manager can act as a gateway to another via the alias. Not connection.
It's also possible to define a client table where a name of "MYCLS" describes all the queue managers available for connection if you prefer that. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|