简体   繁体   English

将消息放在群集队列中

[英]Placing message on clustered queue

We are trying to place message on IBM message clustered queue. 我们正在尝试将消息放置在IBM消息集群队列上。 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? 有人可以帮助我们将消息放在群集队列中吗?

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. MQRC 2085MQRC_UNKNOWN_OBJECT_NAME ,这通常意味着您连接到的队列管理器无法在本地定义的队列或通过其所属的集群找到此队列。

Another reason you get a 2085 is if you try to open a clustered queue for INPUT ( GET ). 收到2085另一个原因是,如果您尝试为INPUTGET )打开群集队列。 You can only OUTPUT ( PUT ) to a clustered queue that is not located on the local queue manager. 您只能OUTPUTPUT )到不位于本地队列管理器集群队列。 If you remove CMQC.MQOO_INPUT_AS_Q_DEF from your openOptions it should fix your problem. 如果从openOptions删除CMQC.MQOO_INPUT_AS_Q_DEF ,它应该可以解决您的问题。 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. 与您的问题无关,优良作法是始终包含CMQC.MQOO_FAIL_IF_QUIESCING这将允许队列管理器正常关闭,并且不会由于正在连接的进程而CMQC.MQOO_FAIL_IF_QUIESCING

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. 部分存储库仅在第一次访问集群队列时才知道,因此在您修复openOptions并尝试再次访问它之前,它可能不会显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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