IBM MQ issue with cluster queue

て烟熏妆下的殇ゞ 提交于 2019-12-08 05:43:31

问题


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?


回答1:


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);



回答2:


Try

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

to put message to MQ



来源:https://stackoverflow.com/questions/17076247/ibm-mq-issue-with-cluster-queue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!