Author |
Message
|
andrey81inmd |
Posted: Tue Aug 09, 2005 10:06 am Post subject: Setting up a QM alias |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
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 |
|
 |
wschutz |
Posted: Tue Aug 09, 2005 10:13 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Backup a little bit for us...are QM1 and QM2 in a queue manager cluster and is MyQueue also in that cluster? If so, you don't need (nor want) to specify a qmgr name, just connect to QM1 and open myQueue, clustering will route your message over to MyQueue at QM2 _________________ -wayne |
|
Back to top |
|
 |
Michael Dag |
Posted: Tue Aug 09, 2005 10:24 am Post subject: Re: Setting up a QM alias |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
andrey81inmd wrote: |
DEFINE QREMOTE(CommonQM) RQMNAME(QM2)
|
MQ uppercases by default...
use DELETE QREMOTE(CommonQM) to remove and then
DEFINE ('CommonQM') RQMNAME('QM2')
if transmission Q and channels are setup correctly it should work... _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
wschutz |
Posted: Tue Aug 09, 2005 10:33 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Michael, I'm afraid to disagree....
His first failure is:
Quote: |
amqsput MyQueue CommonQM
Sample AMQSPUT0 start
MQCONN ended with reason code 2058 |
In this case, "CommonQM" must be the real name of a queue manager on the machine since its the parm to MQCONN, the second failure ...
Quote: |
amqsput CommonQM
Sample AMQSPUT0 start
target queue is CommonQM
MQOPEN ended with reason code 2184
unable to open queue for output
Sample AMQSPUT0 end
|
connects to the defaut qmgr (QM1) but tries to open a qmgr alais definition as a full qremote definiton, which fails since there is no rname specified.
but in any case...I think he want to use clustering and therefore doesn't need a qmgr alias..... _________________ -wayne |
|
Back to top |
|
 |
andrey81inmd |
Posted: Tue Aug 09, 2005 10:40 am Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
wschutz wrote: |
Backup a little bit for us...are QM1 and QM2 in a queue manager cluster and is MyQueue also in that cluster? If so, you don't need (nor want) to specify a qmgr name, just connect to QM1 and open myQueue, clustering will route your message over to MyQueue at QM2 |
QM1 and QM2 are not in the same cluster. QM1 and QM2 are on the same machine, but QM1 is the default QM, so we wouldnt have to specify the QM name when we put a message to a queue in QM1. |
|
Back to top |
|
 |
andrey81inmd |
Posted: Tue Aug 09, 2005 10:43 am Post subject: Re: Setting up a QM alias |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
[quote="Michael Dag]
MQ uppercases by default...
use DELETE QREMOTE(CommonQM) to remove and then
DEFINE ('CommonQM') RQMNAME('QM2')
if transmission Q and channels are setup correctly it should work...[/quote]
When we run this command, we get the following error:
AMQ8405: Syntax error detected at or near end of command segment below:-
define (
AMQ8426: Valid MQSC commands are:
.... |
|
Back to top |
|
 |
wschutz |
Posted: Tue Aug 09, 2005 10:44 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
So if you're not using clustering between QM1 and QM2, then you need a qremote definition on QM1:
Code: |
DEFINE QREMOTE('CommonQM') RNAME('MyQueue') RQMNAME(QM2)
|
Then, "amqsput CommonQM" will work. Of course, you need a transmission queue named QM2 and a channel to QM2 from QM1. _________________ -wayne |
|
Back to top |
|
 |
andrey81inmd |
Posted: Tue Aug 09, 2005 10:53 am Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
wschutz wrote: |
So if you're not using clustering between QM1 and QM2, then you need a qremote definition on QM1:
Code: |
DEFINE QREMOTE('CommonQM') RNAME('MyQueue') RQMNAME(QM2)
|
Then, "amqsput CommonQM" will work. Of course, you need a transmission queue named QM2 and a channel to QM2 from QM1. |
This defines an ordinary remote queue definition. This works for local queues, but not for cluster queues. MyQueue is a cluster queue on QM2. |
|
Back to top |
|
 |
mq_crazy |
Posted: Tue Aug 09, 2005 11:02 am Post subject: |
|
|
 Master
Joined: 30 Jun 2004 Posts: 295
|
Even though its a cluster queue, still its a local queue to that queue manager. |
|
Back to top |
|
 |
andrey81inmd |
Posted: Tue Aug 09, 2005 11:07 am Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
mq_crazy wrote: |
Even though its a cluster queue, still its a local queue to that queue manager. |
It's hosted on a different queue manager on a different machine. There's a difference between "local clustered" queue and "cluster" queue.
I tried this on both a local queue and a cluster queue. It works on local, does not work on cluster. |
|
Back to top |
|
 |
mq_crazy |
Posted: Tue Aug 09, 2005 11:13 am Post subject: |
|
|
 Master
Joined: 30 Jun 2004 Posts: 295
|
I thought you said that the queue is hosted on QM2. Is the queue manager QM2 and other queue manager that actually hosts the queue in same cluster?? |
|
Back to top |
|
 |
andrey81inmd |
Posted: Tue Aug 09, 2005 11:15 am Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
mq_crazy wrote: |
I thought you said that the queue is hosted on QM2. Is the queue manager QM2 and other queue manager that actually hosts the queue in same cluster?? |
Yes, QM2 and this other QM - say QM3, are in the same cluster. QM1 is in a different cluster. QM3 actually hosts MyQueue, so it shows up as cluster queue on QM2. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Aug 09, 2005 11:16 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
So, I think what you are saying is:
MyQueue is a queue which is not a local queue on QM2 but is a queue which is in a cluster which QM2 is also in. Correct? _________________ -wayne |
|
Back to top |
|
 |
andrey81inmd |
Posted: Tue Aug 09, 2005 11:22 am Post subject: |
|
|
Novice
Joined: 19 Jul 2005 Posts: 17
|
wschutz wrote: |
So, I think what you are saying is:
MyQueue is a queue which is not a local queue on QM2 but is a queue which is in a cluster which QM2 is also in. Correct? |
Yes, exactly. It shows up as a cluster queue in QM2 in MQ Explorer. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Aug 09, 2005 11:24 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
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.... _________________ -wayne |
|
Back to top |
|
 |
|