软件开发javamq 7.5

问一个关于 IBM WebSphere MQ的问题,消息错误代码为RC2019

我写了一个生产者程序,每隔5s往MQ发100条消息,又写了一个消费者程序,每隔10s从MQ中取消息,再写入文件,生产者MQ主要代码:MQQueue queue = null;int openOptions = MQConstants.MQOO_OUTPUT| MQConstants.MQOO_FAIL_IF_QUIESCING| MQConstants.MQGMO_WAIT;    if (qM...显示全部

我写了一个生产者程序,每隔5s往MQ发100条消息,又写了一个消费者程序,每隔10s从MQ中取消息,再写入文件,
生产者MQ主要代码:
MQQueue queue = null;
int openOptions = MQConstants.MQOO_OUTPUT
| MQConstants.MQOO_FAIL_IF_QUIESCING
| MQConstants.MQGMO_WAIT;

    if (qMgr == null || !qMgr.isConnected()) {        qMgr = new MQQueueManager(qmName);    }    try {        queue = qMgr.accessQueue(qName, openOptions);        MQMessage putMessage = new MQMessage();        // putMessage.messageId = msgID.getBytes();        // putMessage.writeUTF(message);        putMessage.write(message.getBytes("UTF-8"));        MQPutMessageOptions pmo = new MQPutMessageOptions();        queue.put(putMessage, pmo);        queue.close();    } catch (Exception e) {        e.printStackTrace(System.out);        throw e;    } finally {        try {            if (queue != null) {                try {                    queue.close();                } catch (MQException e) {                    e.printStackTrace();                }            }            if (qMgr != null) {                qMgr.disconnect();            }        } catch (MQException e) {            throw e;        }    }    消费者MQ主要代码:    String[] messages = null;    int count = 0;    try {        qMgr = new MQQueueManager(qmName);    } catch (MQException e) {        throw e;    }    // @SuppressWarnings("deprecation")    // int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT    // | MQC.MQOO_INQUIRE;    // int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF |    // MQConstants.MQOO_OUTPUT;    int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF            | MQConstants.MQOO_INQUIRE ;

// | MQConstants.MQOO_FAIL_IF_QUIESCING;

    MQQueue queue = null;    try {        queue = qMgr.accessQueue(qName, openOptions, null, null, null);        int depth = queue.getCurrentDepth();        messages = new String[depth];        // System.out.println("队列中的消息长度为:" + depth);        // 将队列中的消息读取出来        while (depth-- > 0) {            // System.out.println(depth);            MQMessage msg = new MQMessage();// 读取的队列消息            // msg.messageId = msgID.getBytes();            MQGetMessageOptions gmo = new MQGetMessageOptions();            queue.get(msg, gmo);            int len = msg.getDataLength();            byte[] buf = new byte[len];            msg.readFully(buf, 0, len);            String strmsgCont = new String(buf, "UTF-8");            messages[count++] = strmsgCont;        }    } catch (MQException e) {        e.printStackTrace();    } catch (Exception e) {        e.printStackTrace();    } finally {        if (queue != null) {            try {                queue.close();            } catch (MQException e) {                e.printStackTrace();            }        }        if (qMgr != null) {            qMgr.disconnect();        }    }    return messages;}

刚开始的几次,差不多20s内两边正常收发,之后就报了这个异常MQJE001: 完成代码为 '2',原因为 '2019'。
com.ibm.mq.MQException: MQJE001: 完成代码为 '2',原因为 '2019'。

看了IBM的官方文档解释,也是一头雾水,麻烦谁知道的告诉一下;

注:附IBM官方接释:
2019 (07E3) (RC2019): MQRC_HOBJ_ERROR
Explanation
The object handle Hobj is not valid, for one of the following reasons:
v The parameter pointer is not valid, or (for the MQOPEN call) points to
read-only storage. (It is not always possible to detect parameter pointers that are
not valid; if not detected, unpredictable results occur.)
v The value specified was not returned by a preceding MQOPEN call.
v The value specified has been made invalid by a preceding MQCLOSE call.
v The handle is a shared handle that has been made invalid by another thread
issuing the MQCLOSE call.
v The handle is a nonshared handle that is being used by a thread that did not
create the handle.
v The call is MQGET or MQPUT, but the object represented by the handle is not a
queue.

收起
参与29

查看其它 25 个回答miracle_yao的回答

miracle_yaomiracle_yao软件开发工程师广东工业大学
2015/5/13 16:51:55 - Process(3532.3) User(MUSR_MQADMIN) Program(amqzmur0.exe)
                      Host(YAO-PC) Installation(Installation1)
                      VRMF(7.5.0.2) QMgr(QM_YAO_PC)
                     
AMQ6287: WebSphere MQ VC:\Program Files (x86)\IBM\WebSphere MQ (Installation1)


说明:
WebSphere MQ 系统信息:
产品           :- Windows 7 Ultimate x64 Edition, Build 7600 (MQ Windows
32-bit)
版本           :- C:\Program Files (x86)\IBM\WebSphere MQ (Installation1)
主机信息       :- 7.5.0.2 (p750-002-130627)
操作:
无。
-------------------------------------------------------------------------------
2015/5/13 16:51:55 - Process(4416.437) User(MUSR_MQADMIN) Program(amqrmppa.exe)
                      Host(YAO-PC) Installation(Installation1)
                      VRMF(7.5.0.2) QMgr(QM_YAO_PC)
                     
AMQ9999: 通道“S_YAO_PC”至主机“YAO-PC (192.168.1.103)”已异常结束。

说明:
针对通道“S_YAO_PC”采用进程标识“4416(13020)”运行的通道程序异常结束。主机名为
“YAO-PC (192.168.1.103)”;在某些情况下,主机名无法确定,因此显示为“????”.
操作:
请查看错误日志中有关该通道程序的先前错误消息,以确定故障原因。请注意,可以通过
调整 qm.ini 中“QMErrorLog”节下的“ExcludeMessage”或“SuppressMessage”属性,
完全排除或禁止此消息。要了解进一步的信息,请参阅《系统管理》指南。
----- amqrmrsa.c : 898 --------------------------------------------------------
2015/5/13 16:51:55 - Process(4416.438) User(MUSR_MQADMIN) Program(amqrmppa.exe)
                      Host(YAO-PC) Installation(Installation1)
                      VRMF(7.5.0.2) QMgr(QM_YAO_PC)
                     
AMQ9513: 已达到最大通道数。

说明:
已达到可同时使用的最大通道数。允许通道数是队列管理器配置文件中的一个可配置的参
数。
操作:
等待一些正在工作的通道关闭。当有某些通道可用时再试该操作。
----- amqrcsia.c : 1231 -------------------------------------------------------
2015/5/13 16:51:55 - Process(4416.438) User(MUSR_MQADMIN) Program(amqrmppa.exe)
                      Host(YAO-PC) Installation(Installation1)
                      VRMF(7.5.0.2) QMgr(QM_YAO_PC)
                     
AMQ9999: 通道“S_YAO_PC”至主机“YAO-PC (192.168.1.103)”已异常结束。

说明:
针对通道“S_YAO_PC”采用进程标识“4416(14160)”运行的通道程序异常结束。主机名为
“YAO-PC (192.168.1.103)”;在某些情况下,主机名无法确定,因此显示为“????”.
操作:
请查看错误日志中有关该通道程序的先前错误消息,以确定故障原因。请注意,可以通过
调整 qm.ini 中“QMErrorLog”节下的“ExcludeMessage”或“SuppressMessage”属性,
完全排除或禁止此消息。要了解进一步的信息,请参阅《系统管理》指南。
----- amqrmrsa.c : 898 --------------------------------------------------------
2015/5/13 16:51:55 - Process(4416.439) User(MUSR_MQADMIN) Program(amqrmppa.exe)
                      Host(YAO-PC) Installation(Installation1)
                      VRMF(7.5.0.2) QMgr(QM_YAO_PC)
                     
AMQ9513: 已达到最大通道数。

说明:
已达到可同时使用的最大通道数。允许通道数是队列管理器配置文件中的一个可配置的参
数。
操作:
等待一些正在工作的通道关闭。当有某些通道可用时再试该操作。
软件开发 · 2015-05-14
浏览5008

回答者

miracle_yao
软件开发工程师广东工业大学

回答状态

  • 发布时间:2015-05-14
  • 关注会员:3 人
  • 回答浏览:5008
  • X社区推广