Netlancer created AMQ-5428:
------------------------------

             Summary: Durable Subscriptions are not being setup while link 
stealing is happening
                 Key: AMQ-5428
                 URL: https://issues.apache.org/jira/browse/AMQ-5428
             Project: ActiveMQ
          Issue Type: Bug
          Components: MQTT
    Affects Versions: 5.11.0
         Environment: Activemq 5.11-SNAPSHOT with leveldb and linkstealing 
enabled.
            Reporter: Netlancer


Intermittently, while an mqtt client is reconnecting, the durable subscriptions 
are not setup as error is thrown mentioning subscription is still active.

the same can be reproduced by adding sleep into stopAsync method.
{code:title=ManagedTransportConnection.java|borderStyle=solid}
    @Override
    public void stopAsync() {
        if (!isStopping()) {
            synchronized (this) {
                unregisterMBean(byClientIdName);
                unregisterMBean(byAddressName);
                byClientIdName = null;
                byAddressName = null;
            }
        }
        try {
            Thread.sleep(4000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        super.stopAsync();
    }
{code}

stacktrace:

2014-11-10 08:07:06,632 | WARN  | Error subscribing to  TopicAAA | 
org.apache.activemq.transport.mqtt.strategy.AbstractMQTTSubscriptionStrategy | 
ActiveMQ NIO Worker 2
javax.jms.JMSException: Durable consumer is in use for client: Producer and 
subscriptionName: EXACTLY_ONCE:TopicAAA
        at 
org.apache.activemq.broker.region.TopicRegion.addConsumer(TopicRegion.java:123)[activemq-broker-5.11-SNAPSHOT.jar:5.11-SNAPSHOT]
        at 
org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:427)[activemq-broker-5.11-SNAPSHOT.jar:5.11-SNAPSHOT]
        at 
org.apache.activemq.broker.jmx.ManagedRegionBroker.addConsumer(ManagedRegionBroker.java:244)[activemq-broker-5.11-SNAPSHOT.jar:5.11-SNAPSHOT]
        at 
org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)[activemq-broker-5.11-SNAPSHOT.jar:5.11-SNAPSHOT]
        at 
org.apache.activemq.advisory.AdvisoryBroker.addConsumer(AdvisoryBroker.java:104)[activemq-broker-5.11-SNAPSHOT.jar:5.11-SNAPSHOT]
        at 
org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)[activemq-broker-5.11-SNAPSHOT.jar:5.11-SNAPSHOT]
        at 
org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)[activemq-broker-5.11-SNAPSHOT.jar:5.11-SNAPSHOT]




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

Reply via email to