|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
2082 error: UNKNOWN_ALIAS_BASE_Q with Java MQ Base API |
« View previous topic :: View next topic » |
Author |
Message
|
chrisgclark |
Posted: Tue May 26, 2009 2:09 am Post subject: 2082 error: UNKNOWN_ALIAS_BASE_Q with Java MQ Base API |
|
|
Apprentice
Joined: 26 Mar 2009 Posts: 35
|
Hi,
I getting a 2082 MQException (MQRC_UNKNOWN_ALIAS_BASE_Q) when trying to connect to a queue alias using the Java MQ Base API. I have the following setup:
QM1: q1 (alias to q2)
QM2: q2
QM1 and QM2 part of Cluster, clusC.
I know my queue definitions are sound as I can connect and put messages on QM1 q1 using RFHUtil and a JMS program and the messages end up on QM2 q2. The problem seems to be with my Base MQ API Java program.
After some research I have tried to setup a cluster alias [ define qremote(clusC) rname('') rqmname('') ] on QM1, but still same 2082.
I found some JMS code which seems to address this problem by connecting to QM1, then connecting to the queue using cluster alias/queue name:
Code: |
session.createQueue("queue://clusC/Q1"); |
Anyone know the equivalent in the Base MQ API? I tried
Code: |
queue = qMgr.accessQueue("clusC/Q1", openOptions) |
but got 2085 error, UNKNOWN_OBJECT_NAME
Thanks |
|
Back to top |
|
 |
gunter |
Posted: Tue May 26, 2009 2:44 am Post subject: |
|
|
Partisan
Joined: 21 Jan 2004 Posts: 307 Location: Germany, Frankfurt
|
from manual:
Quote: |
If the alias refers to a queue, it must be another local or remote queue,
defined at this queue manager. |
_________________ Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3 |
|
Back to top |
|
 |
chrisgclark |
Posted: Tue May 26, 2009 3:02 am Post subject: |
|
|
Apprentice
Joined: 26 Mar 2009 Posts: 35
|
Hi gunter,
I think my queue alias is ok. My queue alias (q1) on QM1 refers to q2 on QM2. Q1 and Q2 are part of a cluster.
The alias is working fine when testing with other applications, e.g.RFHutils. |
|
Back to top |
|
 |
chrisgclark |
Posted: Tue May 26, 2009 3:19 am Post subject: |
|
|
Apprentice
Joined: 26 Mar 2009 Posts: 35
|
Hi,
I have also tried:
Code: |
queue = qMgr.accessQueue(Q1, openOptions, clusC, null, null); |
i.e. specifying my cluster alias (clusC) as the the queueManager parameter:
From programming guide, it says this parameter is...
Quote: |
queueManagerName - name of the queue manager on which the queue is defined. |
The above code gives a 2045 error, OPTIONS_NOT_VALID_FOR_TYPE error (options were MQOO_OUTPUT | MQOO_INQUIRE)
If I remove the MQOO_INQUIRE option I can connect to the queue, but then I get a mqrc 2038 NOT_OPEN_FOR_INQUIRE as soon as I try to done something on the queue.
I don't seem to be getting anywhere with this...  |
|
Back to top |
|
 |
mqjeff |
Posted: Tue May 26, 2009 3:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Right, so.
In the base API, there is no notion of "url". There's only the object name you're trying to interact with.
So in the case of any kind of queue, you just need the name of that queue, not any information about where the queue lives - because that's handled separately.
So don't
Code: |
queue = qMgr.accessQueue("clusC/Q1", openOptions) |
Just
Code: |
queue = qMgr.accessQueue("Q1", openOptions) |
|
|
Back to top |
|
 |
chrisgclark |
Posted: Tue May 26, 2009 4:22 am Post subject: |
|
|
Apprentice
Joined: 26 Mar 2009 Posts: 35
|
Hi,
With the help of a colleague this problem is now solved. The following needs to be done if you are putting messages on a queue alias using BaseMQ API:
1. On queue manager containing queue alias, setup cluster alias as follows:
Code: |
define qremote(clusC) rname('') rqmname('') |
2. In Java program, setup opens options:
int openOptions = MQC.MQOO_OUTPUT;
3. In Java program, connect to queue using cluster alias:
Code: |
queue = qMgr.accessQueue("Q1", openOptions, clusC, null, null); |
where qMgr is queue manager running Q1 alias queue, and clusC is the cluster alias defined in step1.
4. In Java program, put messages onto queue in step3. Do not try to inquire or get message from queue. This is not allowed.
mqjeff, thanks for pointing out that the notion of 'url' is only relevant to JMS programming. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|