问题描述
我正在像这样创建一个MQ侦听器,它工作正常,但几分钟或几小时后,由于该异常而断开连接.我不控制服务器.这是通过专用电路,而不是Internet.我怀疑这是网络问题.其他服务在同一电路上运行没有问题.
I am creating an MQ listener like this and it works fine but then after minutes or hours disconnects with this exception. I don't control the server. This is over a dedicated circuit, not the internet. I doubt it's a network issue. Other services run on the same circuit without issue.
MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
QueueConnection qc;
Queue queue;
QueueSession queueSession;
QueueReceiver qr;
public void init() throws JMSException, IOException {
cf.setQueueManager(" ");
cf.setCCDTURL(Path.of(getCcdt()).toUri().toURL());
cf.setSSLPeerName(getSslPeerName());
qc = cf.createQueueConnection();
qc.setExceptionListener(new ExceptionListener() {
@Override
public void onException(JMSException exception) {
log.error(exception);
}
});
queue = new MQQueue(cp.getMqQueue());
queueSession = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
qr = queueSession.createReceiver(queue);
qr.setMessageListener(this);
qc.start();
}
例外:
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with this connection has occurred.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:217) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:273) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.wmq.internal.WMQAsyncConsumerShadow.consumer(WMQAsyncConsumerShadow.java:686) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.callConsumer(RemoteProxyQueue.java:3755) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.processEvent(RemoteProxyQueue.java:4824) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.driveConsumer(RemoteProxyQueue.java:4645) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.deliverMsgs(RemoteProxyQueue.java:5240) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.deliverMsgsReconnectable(RemoteDispatchThread.java:557) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.deliverMsgs(RemoteDispatchThread.java:531) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.run(RemoteDispatchThread.java:305) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:319) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:99) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:343) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:312) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1227) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203) ~[com.ibm.mq.allclient-9.2.0.0.jar:9.2.0.0 - p920-L200710.DE]
grep -C 0 -i -a etHeartbeatInterval mq.log
grep -C 0 -i -a etHeartbeatInterval mq.log
[2:30:37.720.09] 00000065 @16c85cc4 c.i.mq.exits.MQCD ----+----+----+----+---- d setHeartbeatInterval(int) setter [10(0xa)]
--
[2:30:37.721.0X] 00000065 @71ff40ae c.i.mq.exits.MQCD ----+----+----+----+--- d setHeartbeatInterval(int) setter [10(0xa)]
--
[2:30:37.795.1J] 00000065 @71ff40ae c.i.mq.exits.MQCD ----+----+----+----+---- d getHeartbeatInterval() getter [10(0xa)]
[2:30:37.795.1K] 00000065 @7b481be3 c.i.m.j.remote.rfp.RfpID ----+----+----+----+---- { setHeartbeatInterval(int,boolean) [10(0xa)] [false]
[2:30:37.795.1L] 00000065 @7b481be3 c.i.m.j.remote.rfp.RfpID ----+----+----+----+---- } setHeartbeatInterval(int,boolean)
--
[2:30:37.807.0N] 00000065 @43212202 c.i.m.j.remote.rfp.RfpID ----+----+----+----+---- { getHeartbeatInterval(boolean) [true]
[2:30:37.807.0O] 00000065 @43212202 c.i.m.j.remote.rfp.RfpID ----+----+----+----+---- } getHeartbeatInterval(boolean) returns [300(0x12c)] Integer
[2:30:37.807.0P] 00000065 @71ff40ae c.i.mq.exits.MQCD ----+----+----+----+---- d getHeartbeatInterval() getter [10(0xa)]
[2:30:37.807.0Q] 00000065 @71ff40ae c.i.mq.exits.MQCD ----+----+----+----+---- d setHeartbeatInterval(int) setter [300(0x12c)]
--
[2:30:37.811.01] 00000065 @71ff40ae c.i.mq.exits.MQCD ----+----+----+----+---- d getHeartbeatInterval() getter [300(0x12c)]
--
[2:30:37.811.03] 00000065 @a5146c3 c.i.m.j.remote.rfp.RfpID ----+----+----+----+---- { setHeartbeatInterval(int,boolean) [300(0x12c)] [true]
--
[2:30:37.811.05] 00000065 @a5146c3 c.i.m.j.remote.rfp.RfpID ----+----+----+----+---- } setHeartbeatInterval(int,boolean)
--
[2:30:37.817.10] 00000067 @71ff40ae c.i.mq.exits.MQCD ----+- d getHeartbeatInterval() getter [300(0x12c)]
--
[2:30:37.826.0F] 00000065 @71ff40ae c.i.mq.exits.MQCD ----+----+----+----+---- d getHeartbeatInterval() getter [300(0x12c)]
[2:30:37.826.0G] 00000065 @38eff414 c.i.m.j.remote.rfp.RfpID ----+----+----+----+---- { setHeartbeatInterval(int,boolean) [300(0x12c)] [true]
[2:30:37.826.0H] 00000065 @38eff414 c.i.m.j.remote.rfp.RfpID ----+----+----+----+---- } setHeartbeatInterval(int,boolean)
--
[2:30:37.838.0X] 00000065 @71ff40ae c.i.mq.exits.MQCD ----+----+----+----+---- d getHeartbeatInterval() getter [300(0x12c)]
[2:30:37.838.0Y] 00000065 @1bb7bbb4 c.i.m.j.remote.impl.RemoteTCPConnection ----+----+----+----+---- { protocolSetHeartbeatInterval(int) [300(0x12c)]
[2:30:37.838.0Z] 00000065 @1bb7bbb4 c.i.m.j.remote.impl.RemoteTCPConnection ----+----+----+----+---- } protocolSetHeartbeatInterval(int)
--
[2:30:37.948.1A] 00000065 @22b76f8e c.i.mq.exits.MQCD ----+----+----+---- d setHeartbeatInterval(int) setter [10(0xa)]
--
[2:30:37.957.0C] 00000065 @716fc5e c.i.mq.exits.MQCD ----+----+----+----+--- d setHeartbeatInterval(int) setter [10(0xa)]
--
[2:30:37.958.1T] 00000065 @4c4e13bb c.i.mq.exits.MQCD ----+----+----+----+-- d setHeartbeatInterval(int) setter [10(0xa)]
--
[2:30:38.039.0K] 00000065 @4c4e13bb c.i.mq.exits.MQCD ----+----+----+----+--- d getHeartbeatInterval() getter [10(0xa)]
[2:30:38.039.0L] 00000065 @1cf5776d c.i.m.j.remote.rfp.RfpID ----+----+----+----+--- { setHeartbeatInterval(int,boolean) [10(0xa)] [false]
[2:30:38.039.0M] 00000065 @1cf5776d c.i.m.j.remote.rfp.RfpID ----+----+----+----+--- } setHeartbeatInterval(int,boolean)
--
[2:30:38.052.0O] 00000065 @3ed71710 c.i.m.j.remote.rfp.RfpID ----+----+----+----+--- { getHeartbeatInterval(boolean) [true]
[2:30:38.052.0P] 00000065 @3ed71710 c.i.m.j.remote.rfp.RfpID ----+----+----+----+--- } getHeartbeatInterval(boolean) returns [300(0x12c)] Integer
[2:30:38.052.0Q] 00000065 @4c4e13bb c.i.mq.exits.MQCD ----+----+----+----+--- d getHeartbeatInterval() getter [10(0xa)]
[2:30:38.052.0R] 00000065 @4c4e13bb c.i.mq.exits.MQCD ----+----+----+----+--- d setHeartbeatInterval(int) setter [300(0x12c)]
--
[2:30:38.056.02] 00000065 @4c4e13bb c.i.mq.exits.MQCD ----+----+----+----+--- d getHeartbeatInterval() getter [300(0x12c)]
[2:30:38.056.03] 00000065 @218f5897 c.i.m.j.remote.rfp.RfpID ----+----+----+----+--- { setHeartbeatInterval(int,boolean) [300(0x12c)] [true]
[2:30:38.056.04] 00000065 @218f5897 c.i.m.j.remote.rfp.RfpID ----+----+----+----+--- } setHeartbeatInterval(int,boolean)
--
[2:30:38.061.00] 00000069 @4c4e13bb c.i.mq.exits.MQCD ----+- d getHeartbeatInterval() getter [300(0x12c)]
--
[2:30:38.072.0I] 00000065 @4c4e13bb c.i.mq.exits.MQCD ----+----+----+----+--- d getHeartbeatInterval() getter [300(0x12c)]
[2:30:38.072.0J] 00000065 @5d299189 c.i.m.j.remote.rfp.RfpID ----+----+----+----+--- { setHeartbeatInterval(int,boolean) [300(0x12c)] [true]
[2:30:38.072.0K] 00000065 @5d299189 c.i.m.j.remote.rfp.RfpID ----+----+----+----+--- } setHeartbeatInterval(int,boolean)
--
[2:30:38.085.02] 00000065 @4c4e13bb c.i.mq.exits.MQCD ----+----+----+----+--- d getHeartbeatInterval() getter [300(0x12c)]
[2:30:38.085.03] 00000065 @51b68e6a c.i.m.j.remote.impl.RemoteTCPConnection ----+----+----+----+--- { protocolSetHeartbeatInterval(int) [300(0x12c)]
--
[2:30:38.085.05] 00000065 @51b68e6a c.i.m.j.remote.impl.RemoteTCPConnection ----+----+----+----+--- } protocolSetHeartbeatInterval(int)
断开连接发生在90分钟或大约50分钟之后:
Disconnects appear at either after 90 mins or else approx 50 mins:
15:28 start
16:59 restart (90 min)
17:55 restart (55 min)
18:51 restart (54 min)
19:47 restart (56 min)
3:06 start
4:47 restart (90 min)
5:38 restart (50 min)
6:34 restart (56 min
7:25 restart (50 min)
8:21 restart (55 min)
9:57 restart (95 min)
10:48 restart (50 min)
11:39 restart (51 min)
12:30 restart (51 min)
13:26 restart (56 min)
14:22 restart (56 min)
15:13 restart (51 min)
数据包捕获如下所示.请参阅#162,我发送了TLS数据包,然后进行了9次重新传输,然后在发送#162之后60秒断开了连接.
Packet capture looks like this. See #162, I sent TLS packet, then 9 retrans, then disconnect 60 sec after #162 was sent.
192.168.77.102 = me (MQ JMS client)
192.168.77.1 = router(next hop)
160.43.166.189 = MQ server
推荐答案
服务提供商必须在其端设置HBINT(30)才能解决此问题.奇怪的是,考虑到他们设置了这些会话的负载,他们还没有那么正确.
The service provider had to set HBINT(30) on their end to fix the issue. Very odd that they wouldn't have had that correct already considering they set up loads of these sessions.
这篇关于IBM MQ会话断开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!