永久JMS连接失败,但没有错误 [英] Permanent JMS Connection failure but no error

查看:146
本文介绍了永久JMS连接失败,但没有错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3台服务器-2台运行相同的Spring Integration应用程序的服务器和1台Websphere MQ服务器.两个应用程序都连接到同一主题.

I have 3 servers - 2 servers running identical spring integration applications and 1 websphere MQ server. Both applications connect to the same topic.

在似乎不可预测的时间(有时数小时,有时是数天)之后,两个应用程序都停止接收消息.在两个应用程序上几乎同时会发生此故障.应用程序需要重新启动才能恢复.

After what seems like an unpredictable amount of time (sometimes hours, sometimes days) both applications stop receiving messages. This failure occurs on both applications at approximately the same time. The applications require a restart in order to recover.

两个应用程序都具有以下配置:

Both applications have the following config:

<bean id="jmsInputFactory" class="com.ibm.mq.jms.MQTopicConnectionFactory">
    <property name="queueManager" value="MyQM" />
    <property name="hostName" value="x.x.x.x" />
    <property name="port" value="15004" />
    <property name="transportType" value="1" />
    <property name="channel" value="MYCHANNEL" />
    <property name="clientId" value="${system.description}"></property>
</bean>

<bean id="cachedConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
    <property name="targetConnectionFactory" ref="jmsInputFactory"></property>
</bean>

<bean id="jmsDestinationResolver"
    class="org.springframework.jms.support.destination.DynamicDestinationResolver" />

<jms:message-driven-channel-adapter 
    channel="myChannel" 
    connection-factory="cachedConnectionFactory"
    destination-resolver="jmsDestinationResolver"
    pub-sub-domain="true"
    destination-name="MYTOPIC" />

我似乎在任何地方都找不到任何错误消息,并且对如何进行进一步的调查感到困惑.有人有什么建议吗?

I can't seem to find any error message anywhere and am at a loss for how to go about further investigation. Does anyone have any suggestions?

推荐答案

这是一个常见问题;一些网络(防火墙,路由器)会静默丢弃空闲连接;如果未通知供应商客户端套接字关闭,则不会在堆栈上传播异常以强制重新连接.

This is a common problem; some networks (firewalls, routers) silently drop idle connections; if the vendor client is not informed of the socket closure, then no exception is propagated up the stack to force a reconnect.

解决这些问题的常用方法是启用某种类型的心跳,以使空闲套接字保持活动状态(从网络的角度来看).有关如何进行设置的信息,请参阅JMS供应商的文档.

The usual solution to these issues is to enable heartbeats of some kind to keep idle sockets active (from the network's perspective). Refer to your JMS vendor's documentation on how to set that up.

这篇关于永久JMS连接失败,但没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆