以下是使用时
int topicOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;
MQTopic mqTopic = qmgr.AccessTopic(mqCloneSpecs.topicString, "",
MQC.MQTOPIC_OPEN_AS_PUBLICATION, topicOptions);
程序的上述部分构建了一个 QueueManager 列表和一个 Topics 列表,用于调用 Windows 服务中的侦听器类。
int tLoopCounter = 0;
foreach (MQTopic topic in topicOut)
{
tLoopCounter++;
// NOTE: We blow up here with 2019 MQRC_HOBJ_ERROR if we access the property topic.Name
//Console.WriteLine("Loop through topics topic.IsOpen: " + topic.IsOpen);
//Console.WriteLine(" OpenOptions:" + topic.OpenOptions);
debugLocation = "4053";
Console.WriteLine(" OpenStatus=" + topic.OpenStatus);
debugLocation = "4054";
i = tLoopCounter - 1;
Console.WriteLine("i=" + i);
debugQueueInfo = " topicPut #" + tLoopCounter + " QueueMgr:" + queueManagerForTopicsOut[i].Name.TrimEnd();
// currently getting 2019 : MQRC_HOBJ_ERROR on the line below
debugLocation = "4055";
debugQueueInfo += "Topic:" + topic.Name;
Console.WriteLine("Pump:Topic.Put:" + debugLocation + ":" + debugQueueInfo);
debugLocation = "4057";
topic.Put(mqMessage);
Console.WriteLine("Pump:Topic.Put completed");
}
当我尝试添加查询选项时,如下所示:
int topicOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE;
然后我死于此错误:
DebugLocation=Q3012 异常:System.ApplicationException:访问队列中的 MQException ---> IBM.WMQ.MQException:MQRC_OPTIONS_ERROR
此外,来自 Console.WriteLIne 的 OpenStatus=True,位于 debugLocation=4053。我的第一个想法是,如果它被关闭,那会导致这个错误。