xml - ActiveMQ 5.11.1 不断抛出EOFException 不发送消息

标签 xml apache shell debugging activemq

我有一个运行在几个不同服务器上的 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>

如有任何帮助,我们将不胜感激!

最佳答案

我遇到了同样的问题并通过配置 OpenWire 协议(protocol)解决了它。默认的 OpenWire 设置期望连接上的流量在 10 秒内,然后在 30 秒内。您将在日志中看到实际使用的值。我通过设置禁用了这个超时(这在我的场景中没问题......):wireFormat.maxInactivityDuration=0

整个网址:

tcp://localhost:61616?connectionTimeout=0&keepAlive=true&useInactivityMonitor=false&wireFormat.maxInactivityDuration=0

或者确保您立即并定期使用连接。

http://activemq.apache.org/configuring-wire-formats.html

关于xml - ActiveMQ 5.11.1 不断抛出EOFException 不发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31966447/

相关文章:

java - 我可以将参数从布局 XML 传递到 MainActivity 中的方法吗?

apache - 如何配置SVN Web访问不同的写入权限?

linux - 如何授予 apache 使用 NTFS 分区上的目录的权限?

php - WordPress Apache VirtualAlloc 和 VirtualFree 失败,PHP 内存不足

linux - 将 Windows 批处理文件移植到 shell 脚本。如果可能的话并行执行任务

java - android - 从我的应用中上次访问的页面恢复

java - 从 Java 读取 XML 字符串

xml - 修改部分XML元素名称并替换为增量编号

ruby - Linux 使用重定向运行子进程而不产生新进程

node.js - 从 bash 脚本运行 Node