I have multiple listeners sharing same connection and the broker url has maxReconnectAttempts property set to 5. If I restart the broker, the ActiveMQ layer tries 5 reconnect attempts then gives up and the listener throws up connection refused exception and then tries to refresh the jms connection and says its refreshed but there is not connection made to ActiveMQ and the listener again throws up connection refused exception and again refreshes the jms connection but fails. This process continues indefinitely. However, I use single listener and no sharing of connection, this works fine. The ActiveMQ layers tries 5 reconnect attempts fails, listener throws up exception and again triggers reconnect attempts which does not happens in case of multiple listener. This issue doesn't happen with ActiveMQ 5.8.0
I am attaching some error logs that I observed. errorlogs.txt <http://activemq.2283324.n4.nabble.com/file/n4690929/errorlogs.txt> Steps to reproduce this issue: <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL" value="failover:(tcp://<hostname1>:61616?wireFormat.maxInactivityDuration=120000,tcp://<hostname2>:61616?wireFormat.maxInactivityDuration=120000)?randomize=false&maxReconnectAttempts=5" /> </bean> <bean id="jmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop"> <property name="connectionFactory" ref="connectionFactory" /> </bean> <amq:topic id="testTopic" physicalName="test.topic"/> <bean id="jmsContainer1" class="org.springframework.jms.listener.DefaultMessageListenerContainer" p:connectionFactory-ref="jmsConnectionFactory" p:destination-ref="testTopic" p:pubSubDomain="true" p:subscriptionDurable="false" p:sessionTransacted="true" p:messageListener-ref="consumer" /> <bean id="jmsContainer2" class="org.springframework.jms.listener.DefaultMessageListenerContainer" p:connectionFactory-ref="jmsConnectionFactory" p:destination-ref="testTopic" p:pubSubDomain="true" p:subscriptionDurable="false" p:sessionTransacted="true" p:messageListener-ref="consumer" /> Use this configuration and start the application. Now restart the ActiveMQ broker once the listeners successfully connect. -- View this message in context: http://activemq.2283324.n4.nabble.com/Listener-is-not-able-to-connect-again-once-maxReconnectAttempts-are-exhausted-by-the-ActiveMQ-layers-tp4690929.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.