Details
Description
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.
@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(); }
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]
Attachments
Issue Links
- duplicates
-
AMQ-5473 Race condition caused by Linkstealing might make durable subs inactive
- Resolved