小编Irm*_*akA的帖子

为什么我会收到 MQRC_NO_MSG_AVAILABLE?

我有以下代码:

        MQQueueManager mqm = null;
        MQQueue mqQueue = null;
        try
        {
            mqm = new MQQueueManager("SWIFTQM", "SWIFTCHANNEL", "localhost");
            mqQueue = mqm.AccessQueue("SWIFTQ", MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING);
            MQMessage mqMsg = new MQMessage();
            MQGetMessageOptions mqGetMsgOpts = new MQGetMessageOptions();
            mqGetMsgOpts.Options |= MQC.MQGMO_SYNCPOINT;
            mqQueue.Get(mqMsg, mqGetMsgOpts);
            string s1 = "";
            if (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) == 0)
                s1 = mqMsg.ReadString(mqMsg.MessageLength);
            string s2 = "";
            mqQueue.Get(mqMsg, mqGetMsgOpts);
            if (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) == 0)
                s2 = mqMsg.ReadString(mqMsg.MessageLength);
        }
        finally
        {
            if (mqQueue != null)
                mqQueue.Close();
            if (mqm != null)
                mqm.Disconnect();
            if (mqm != null)
                mqm.Close(); …
Run Code Online (Sandbox Code Playgroud)

.net ibm-mq

2
推荐指数
1
解决办法
5234
查看次数

标签 统计

.net ×1

ibm-mq ×1