java - Resolving MQRC 2195 errors in IBM MQ standalone application -
solved
i found answer ibm technote iz66146
hope helps others same problem.
i wrote simple method read messages mq queue.
in loop, try read message (with waitinterval). after reading message queue, 2195 return code returned. how can resolve this?
here simplified version of code without exception handling or other thing.
public static void main(string args[]) { mqexception.logexclude(mqexception.mqrc_no_msg_available); mqexception.logexclude(mqexception.mqrc_unexpected_error); mqexception.log = null; while (true) { incomedeploymsg = readfromqueue(waitreadinterval); system.out.println(dateformater.format(new date()) + " income msg"); } } public string readfromqueue(int waitinterval) throws mqexception{ mqmessage message = new mqmessage(); try { if (m_inqueue == null || !m_inqueue.isopen()) m_inqueue = m_mqqmgr.accessqueue(m_inqueuename, cmqc.mqoo_inquire + cmqc.mqoo_fail_if_quiescing + cmqc.mqoo_input_shared); message.messageid = cmqc.mqmi_none; mqgetmessageoptions gmo = new mqgetmessageoptions(); gmo.options = cmqc.mqgmo_wait; gmo.waitinterval = waitinterval; m_inqueue.get(message, gmo); return message.readstringofcharlength(message.getmessagelength()); } catch (mqexception mqe) { throw mqe; } { message.clearmessage(); } } the first line in result not code!!! think ibm's classes print out on standard output. how can resolve error?
result:
mqje001: completion code '2', reason '2195'.
2013-05-15 11:44:27 income msg
comment out 2 lines mqexception.logexclude() , use:
mqexception.log = null;
Comments
Post a Comment