Reputation: 2759
We are trying to place message on IBM message clustered queue. When we place the message on the queue the following error will be thrown:
MQJE001: Completion Code '2', Reason '2085'.
When we try to place a message on a local queue on one of our queue managers it's working fine. But on a clustered queue it does not work.
MQQueue queue = null;
MQMessage mqMessage = null;
MQEnvironment.hostname = settings.getServer();
MQEnvironment.channel = settings.getChannel();
MQEnvironment.port = settings.getPort();
MQQueueManager queueManager = new MQQueueManager(settings.getQueueManager());
int openOptions = CMQC.MQOO_INPUT_AS_Q_DEF | CMQC.MQOO_OUTPUT;
queue = queueManager.accessQueue(settings.getQueue(), openOptions);
Can someone help us with placing message on a clustered queue?
Upvotes: 1
Views: 772
Reputation: 10642
MQRC 2085
is MQRC_UNKNOWN_OBJECT_NAME
which normally means the queue manager you are connected to can't find this queue either locally defined or via the cluster(s) it is a member of.
Another reason you get a 2085
is if you try to open a clustered queue for INPUT
(GET
). You can only OUTPUT
(PUT
) to a clustered queue that is not located on the local queue manager. If you remove CMQC.MQOO_INPUT_AS_Q_DEF
from your openOptions
it should fix your problem. Unrelated to your problem, it is good practice to always include CMQC.MQOO_FAIL_IF_QUIESCING
this will allow the queue manager to shutdown normally and not be held up by your process being connected.
int openOptions = CMQC.MQOO_FAIL_IF_QUIESCING | CMQC.MQOO_OUTPUT;
You can confirm if the queue manager you are connected too knows about this queue in its partial repository along with which cluster it is a member of and what cluster queue managers it is hosted on with the following command:
DIS QC(clustered_queue_name_here) CLUSTER CLUSQMGR
A partial repository only learns about a clustered queue the first time it is accessed so it may not show up until you fix your openOptions
and try to access it again.
Upvotes: 2