activemq 错误收集
来源:互联网 发布:php exec 返回值127 编辑:程序博客网 时间:2024/06/05 16:59
[ERROR] 2008-08-12 15:16:57 method: org.springframework.jms.listener.DefaultMessageListenerContainer.handleListenerSetupFailure(DefaultMessageListenerContainer.java:666)
Setup of JMS message listener invoker failed - trying to recover
javax.jms.IllegalStateException: The Consumer is closed
at org.apache.activemq.ActiveMQMessageConsumer.checkClosed(ActiveMQMessageConsumer.java:612)
at org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:467)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(AbstractPollingMessageListenerContainer.java:375)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:300)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:254)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:870)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:810)
at java.lang.Thread.run(Thread.java:595)
I guess this is an Active MQ bug which should have been fixed in Version 5.2 (see active MQ forum and jira for this)
The problem is a bug in the Inactivity Monitor which is not working properly in versions < 5.2. and blocking after getting the ConnectionInactive for too long exception.
Since i still use 4.1.1 i tried the fix using tcp url and setting the wiredFormat.maxInactivityDuration parameter within the url and it seams to work now.
But nevertheless the problem now is that i don't have the failover handling so i hope my broker will never die ...
Resolution:
- <transportConnectors>
- <transportConnector name="openwire"
- uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"/>
- </transportConnectors>
- <transportConnectors>
- <transportConnector name="openwire"
- uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"/>
- </transportConnectors>
<transportConnectors> <transportConnector name="openwire"uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"/></transportConnectors>
versus on the consumer/producer, e.g.,
- ActiveMQConnectionFactory connectionFactory = new
- ActiveMQConnectionFactory("failover:(tcp://brokerhost:61616)?wireFormat.maxInactivityDuration=0");
- ActiveMQConnectionFactory connectionFactory = new
- ActiveMQConnectionFactory("failover:(tcp://brokerhost:61616)?wireFormat.maxInactivityDuration=0");
ActiveMQConnectionFactory connectionFactory = newActiveMQConnectionFactory("failover:(tcp://brokerhost:61616)?wireFormat.maxInactivityDuration=0");
Effects:
failover depends on the InactivityMonitor - but also socket death too
- which might take a while to percolate through.
maxInactivityDuration=0 这样的参数,否则当一段时间没有消息发送时会抛出"Channel was inactive for too long"
- <bean
- class="org.apache.activemq.ActiveMQConnectionFactory">
- <property name="brokerURL">
- <value>tcp://localhost:61616?connectionTimeout=0&wireFormat.maxInactivityDuration=0</value>
- </property>
- </bean>
- <bean
- class="org.apache.activemq.ActiveMQConnectionFactory">
- <property name="brokerURL">
- <value>tcp://localhost:61616?connectionTimeout=0&wireFormat.maxInactivityDuration=0</value>
- </property>
- </bean>
<bean class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL"> <value>tcp://localhost:61616?connectionTimeout=0&wireFormat.maxInactivityDuration=0</value> </property> </bean>
如果maxInactivityDuration=0,当重启应用时,测试发现,监听器将不能接收消息了 ,也许应该像下面这样:
- <bean id="queueConnectionFactory"
- class="org.apache.activemq.spring.ActiveMQConnectionFactory">
- <property name="brokerURL"
- value="failover:(tcp://195.2.199.9:61616?wireFormat.maxInactivityDuration=1000)&maxReconnectDelay=1000"/>
- <property name="useAsyncSend" value="true"/>
- </bean>
- <bean id="queueConnectionFactory"
- class="org.apache.activemq.spring.ActiveMQConnectionFactory">
- <property name="brokerURL"
- value="failover:(tcp://195.2.199.9:61616?wireFormat.maxInactivityDuration=1000)&maxReconnectDelay=1000"/>
- <property name="useAsyncSend" value="true"/>
- </bean>
<bean id="queueConnectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory"><property name="brokerURL" value="failover:(tcp://195.2.199.9:61616?wireFormat.maxInactivityDuration=1000)&maxReconnectDelay=1000"/><property name="useAsyncSend" value="true"/> </bean>
2.ActiveMQ broker brokes down on client reconnect
Example exception trace repeated in logs
javax.jms.InvalidClientIDException: Broker: 10.155.1.179 - Client: clientId_50002500 already connected from /10.159.226.179:2222
at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:205)
at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:81)
at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:72)
at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:81)
at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91)
at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:657)
at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:86)
at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:125)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:281)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:178)
at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:67)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:134)
at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:138)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:185)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:172)
at java.lang.Thread.run(Thread.java:595)
When unplugging cable from
the broker and then pluging it in again, client tries to reconnect, but in
broker old client connection still exists and broker fails with lots of
different exceptions going one after another.
The queues after that become corrupted somehow and you need to restart the
broker.
收做笔记,来自:http://blog.csdn.net/xiaoming444/article/details/3536915
- activemq 错误收集
- activemq 错误收集
- ActiveMQ错误
- activemq 使用教程收集
- activeMQ资料收集
- activemq报错问题收集
- 错误收集
- 错误收集
- 错误收集
- 错误收集
- activemq 启动错误
- ActiveMQ第一次运行错误
- ActiveMQ常见错误
- 有关activeMQ的优秀博文收集
- Apache ActiveMQ启动DEMO错误
- Apache ActiveMQ启动DEMO错误
- 小错误收集
- VC开发错误收集
- 时间正则表达式
- jQuery Select 操作
- 杭电 ACM 1.2.2
- android平台,视频转码加速思路(FFMPEG)
- D'Fusion中lua调用c++生成的dll库,并且lua调用c++代码(遍历文件夹中整个目录)
- activemq 错误收集
- VS2010编译错误—LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
- 解决宿主机不能访问虚拟机CentOS中的站点
- build.prop
- 第三章 类类型
- 块设备驱动分析
- 浅谈界面建模
- android 系统属性 build.prop
- ios UITableView封装之下拉-上提-图片异步加载