ACTIVEMQ Channel was inactive for too (>30000)long

警告问题

生产服务器上,MQ Produce和consumer端同时报如下错误,导致不能正常工作。
Transport Connection to: tcp://0.0.0.0:54301 failed: java.io.EOFException | org.apache.activemq.broker.TransportConnection.Transport |
 ActiveMQ Transport: tcp:///0.0.0.0:54301@61617
2017-04-24 16:22:18,049 | WARN  | Transport Connection to: tcp://0.0.0.0:54300 failed: java.io.EOFException | org.apache.activemq.broker.TransportConnection.Transport |
 ActiveMQ Transport: tcp:///0.0.0.0:54300@61617
2017-04-25 06:07:16,707 | WARN  | Transport Connection to: tcp://0.0.0.0:15975 failed: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too
 (>30000) long: tcp://0.0.0.0:15975 | org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ InactivityMonitor Worker

官网解释如下:

2012-06-26 17:13:55,712 | DEBUG | 30000 ms elapsed since last read check. | org.apache.activemq.transport.AbstractInactivityMonitor | InactivityMonitor ReadCheck
2012-06-26 17:13:55,712 | DEBUG | No message received since last read check for tcp:///127.0.0.1:52659! Throwing InactivityIOException. | org.apache.activemq.transport.AbstractInactivityMonitor | InactivityMonitor ReadCheck
2012-06-26 17:13:55,714 | DEBUG | Transport Connection to: tcp://127.0.0.1:52659 failed: 
org.apache.activemq.transport.InactivityIOException: Channel was inactive for too (>30000) long: tcp://127.0.0.1:52659 |
org.apache.activemq.broker.TransportConnection.Transport | InactivityMonitor Async Task: 
java.util.concurrent.ThreadPoolExecutor$Worker@6a346239
org.apache.activemq.transport.InactivityIOException: Channel was inactive for too (>30000) long: tcp://127.0.0.1:52659
    at org.apache.activemq.transport.AbstractInactivityMonitor$4.run(AbstractInactivityMonitor.java:187)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680) 
Setting transport.useInactivityMonitor=false will disable the InactivityMonitor. Configuring wireFormat.maxInactivityDuration=0 will achieve the same result.



<beans xmlns="http://activemq.org/config/1.0">

  <broker brokerName="receiver">
    <transportConnectors>
      <transportConnector uri="tcp://localhost:62002"/>
    transportConnectors>

    <networkConnectors>
      <networkConnector uri="static:(tcp://somehost:62001?wireFormat.maxInactivityDuration=0)"/>
    networkConnectors>

    <persistenceAdapter>
      <memoryPersistenceAdapter/>
    persistenceAdapter>
  broker>

beans>

解决方法:

 查看配置,在activemq的 conf/activemq.xml 里设置了InactivityMonitor的连接超时时间导致,如:
通过设置连接URL的属性: tcp:/ / 0.0.0.0:61616 ? wireFormat.maxInactivityDuration = 30000,表示如果30秒没有数据被读取,接InactivityMonitor假定有一个连接的问题。 InactivityMonitor抛出一个InactivityIOException和关闭相关的转换连接.
解决方案:wireFormat.maxInactivityDuration=0,禁用InactivityMonitor 

uri=”tcp://0.0.0.0:61616?wireFormat.maxInactivityDuration=30000”

 修改为

uri=”tcp://0.0.0.0:61616?wireFormat.maxInactivityDuration=0”

你可能感兴趣的:(activemq配置)