activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhi (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AMQ-5510) Listener is not able to connect again once maxReconnectAttempts are exhausted by the ActiveMQ layers.
Date Fri, 09 Jan 2015 10:24:34 GMT
Abhi created AMQ-5510:
-------------------------

             Summary: Listener is not able to connect again once maxReconnectAttempts are
exhausted by the ActiveMQ layers.
                 Key: AMQ-5510
                 URL: https://issues.apache.org/jira/browse/AMQ-5510
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.10.0
         Environment: ActiveMQ 5.10
            Reporter: Abhi


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


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&amp;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"/>

    <!-- The message listener container to invoke the consumer -->
    <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.

I am attaching some debug logs for reference.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message