我在几个不同的服务器上运行AMQ 5.11.1实例。它们都配置相同并连接到同一网关。在一个特定的服务器上,我不断看到这条消息:
2015-08-12 08:53:59,026 | DEBUG | queue://server-01.lookupdata expiring messages .. | org.apache.activemq.broker.region.Queue | ActiveMQ Broker[server-01] Scheduler
2015-08-12 08:53:59,029 | DEBUG | queue://server-01.lookupdata expiring messages done. | org.apache.activemq.broker.region.Queue | ActiveMQ Broker[server-01] Scheduler
2015-08-12 08:54:08,355 | DEBUG | 30000ms elapsed since last read check. | org.apache.activemq.transport.AbstractInactivityMonitor | ActiveMQ InactivityMonitor ReadCheckTimer
2015-08-12 08:54:08,407 | DEBUG | 30000ms elapsed since last read check. | org.apache.activemq.transport.AbstractInactivityMonitor | ActiveMQ InactivityMonitor ReadCheckTimer
2015-08-12 08:54:08,411 | INFO | Network connection between vm://server-01#2 and tcp://gateway/209.221.27.54:55616@34260 shutdown due to a local error: java.io.EOFException | org.apache.activemq.network.DemandForwardingBridgeSupport | ActiveMQ Transport: tcp://gateway/209.221.27.54:55616@34260
2015-08-12 08:54:08,414 | DEBUG | The local Exception was: java.io.EOFException | org.apache.activemq.network.DemandForwardingBridgeSupport | ActiveMQ Transport: tcp://gateway/209.221.27.54:55616@34260
java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:392)[:1.7.0_71]
at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:258)[activemq-client-5.11.1.jar:5.11.1]
at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:221)[activemq-client-5.11.1.jar:5.11.1]
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:213)[activemq-client-5.11.1.jar:5.11.1]
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)[activemq-client-5.11.1.jar:5.11.1]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_71]
2015-08-12 08:54:08,418 | DEBUG | stopping server-01 bridge to production | org.apache.activemq.network.DemandForwardingBridgeSupport | ActiveMQ BrokerService[server-01] Task-2
2015-08-12 08:54:08,420 | DEBUG | Unregistering MBean org.apache.activemq:brokerName=server-01,connector=networkConnectors,networkConnectorName=linkToGatewayController1,networkBridge=tcp_//209.221.27.54_55616,type=Broker | org.apache.activemq.broker.jmx.ManagementContext | ActiveMQ BrokerService[server-01] Task-2
调试输出没有帮助,我无法确定导致此连接不断丢失的服务器实例之间的区别。
它有足够的记忆力:
jps -v | grep activemq
40359 activemq.jar -Xmx8G
这是我的activemq.xml的一部分:
<networkConnector name="linkToGateway"
uri="static:(tcp://gateway:55616)"
networkTTL="3"
duplex="false"
prefetchSize="2"
>
<excludedDestinations>
<queue physicalName=">"/>
</excludedDestinations>
<staticallyIncludedDestinations>
<queue physicalName="server-01.lookupdata" />
</staticallyIncludedDestinations>
</networkConnector>
任何帮助将不胜感激!
答案 0 :(得分:2)
我遇到了同样的问题,并通过配置OpenWire协议解决了这个问题。默认的OpenWire设置期望在10秒内和之后的30秒内连接上的流量。您将在日志中看到实际使用的值。我通过设置wireFormat.maxInactivityDuration=0
整个网址:
tcp://localhost:61616?connectionTimeout=0&keepAlive=true&useInactivityMonitor=false&wireFormat.maxInactivityDuration=0
或确保您立即定期使用该连接。
答案 1 :(得分:1)
最初我打算将蒂姆·比什的答案标记为正确,但似乎他将其删除了。
网络连接是个问题。某些联系被杀死,在调查和清除这些问题后,事情开始顺利进行。
答案 2 :(得分:0)
首先要确保你的连接没有像Tim Bish暗示的那样被外部杀死。
其次,请查看以下thread,其中描述了具有类似症状的ActiveMQ错误。可能你需要更新ActiveMQ。