简体   繁体   中英

IBM MQ issue with cluster queue

Not able to put a message to a cluster queue on a remote queue manager. I am using MQGetMessageOptions and MQPutMessageOptions. I am using 7.5 MQ server and client (7.5.0.1)

It throws reason code - 2085- message -CompCode: 2, Reason: 2085

The queue and queue manager are connected using MQ clusters.

 mqQueue = mqQueueMgr.AccessQueue("queue name", MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_INPUT_SHARED | MQC.MQOO_BROWSE);

I tried to put a test message using amqsput.exe it works fine there.

Any thoughts?

This call:

mqQueue = mqQueueMgr.AccessQueue("queue name", MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_INPUT_SHARED | MQC.MQOO_BROWSE);

opens the cluster queue for getting messages. To get messages, application must be connected to the local queue manager. A local queue manager means the queue manager to which your application is connected. The queue manager can be on the same machine as your application or on a different machine. Messages can't be got from a remote queue manager. Messages can be put a cluster queue when application is connected to a different queue manager in the cluster than the queue manager that hosts the cluster queue.

AMQSPUT works because it is opening the queue for Put and not for Get.

So to solve your problem the option must be changed as:

mqQueue = mqQueueMgr.AccessQueue("queue name", MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_OUTPUT);

Try

  MQQueue queue = queueManageArg.AccessQueue(queueNameArg,
                MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);

to put message to MQ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM