diff options
| author | Robert Gemmell <robbie@apache.org> | 2012-02-19 17:49:23 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2012-02-19 17:49:23 +0000 |
| commit | 5a593b1b1cd31b272bec1d09a1940f7e6a517018 (patch) | |
| tree | c391329f2ca4e82ead52e2beddf7b576fbec0cf1 /qpid/java/broker/src/main | |
| parent | ab3fbd77246d79b562651d55590a21ed15354ed3 (diff) | |
| download | qpid-python-5a593b1b1cd31b272bec1d09a1940f7e6a517018.tar.gz | |
QPID-3855: only increment activeConsumerCount during registration if the subscription is active. Add unit test to identify the issue and check behaviour following various state change notifications.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1291026 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src/main')
| -rw-r--r-- | qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java index c6d634fb28..891a492b7f 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java @@ -100,7 +100,7 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener, Mes private Exchange _alternateExchange; - private final QueueEntryList _entries; + private final QueueEntryList<QueueEntry> _entries; private final SubscriptionList _subscriptionList = new SubscriptionList(); @@ -449,7 +449,10 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener, Mes } } - _activeSubscriberCount.incrementAndGet(); + if(subscription.isActive()) + { + _activeSubscriberCount.incrementAndGet(); + } subscription.setStateListener(this); subscription.setQueueContext(new QueueContext(_entries.getHead())); |
