gpt4 book ai didi

c# - 不连续读取来自 IBM MQ Queue 的消息

转载 作者:太空宇宙 更新时间:2023-11-03 16:15:19 25 4
gpt4 key购买 nike

当我在一个导入队列中有 2000 条消息时,当我通过这样的方式读取它时

MQQueue mqQueue = null; 
MQQueueManager mqQMgr=null;
try
{
//Create connection to queue manager
mqQMgr = new MQQueueManager("Queue Manager name", properties);
//Access the queue
mqQueue = mqQMgr.AccessQueue(QueueName, MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_INPUT_SHARED | MQC.MQOO_BROWSE);
for(int i=1;i<2000;i++)
{
//read the messages
mqMsg=new MQMessage();
mqQueue.Get(mqMsg);
}
}
catch(MQException mqe)
{
//If no messages in the queue , break. (if not, catch any error)
}
finally
{
mqQueue.Close(); //Close the MQ Queue
mqQMgr.Disconnect(); //Disconnect the MQ Manager
}

每当我阅读时,管理器都会随机处理,例如前 800 条消息,然后返回

"MQRC_HANDLE_NOT_AVAILABLE" (comp code:2 , reason code:2017).

我没有在上面的代码中关闭队列/管理器吗?请分享您的想法,以便处理所有消息。我通过 MQ.net 类使用 7.5 MQ 客户端。日志文件包含以下信息。

AMQ9051: WebSphere MQ could not find the security policy definition. Compcode 2 : reason 2017 EXPLANATION: The security policy definition is not defined. ACTION: Security policy definition must be defined before this action.

最佳答案

我尝试了您的示例代码片段,对我来说效果很好。我没有看到 2017 错误。

错误日志中的条目可能与您的问题有关。您是否为队列设置了安全策略并期望将已签名/已签名和加密的消息放入队列/从队列中取出?可能值得与 IBM 开票/PMR。

关于c# - 不连续读取来自 IBM MQ Queue 的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15962699/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com