diff options
Diffstat (limited to 'qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java')
-rw-r--r-- | qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java | 10 |
1 files changed, 8 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 f449095eb1..7effb1c0f8 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 @@ -1642,13 +1642,15 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener while (!sub.isSuspended() && !atTail && iterations != 0) { + boolean queueEmpty = false; + try { sub.getSendLock(); atTail = attemptDelivery(sub); if (atTail && getNextAvailableEntry(sub) == null) { - sub.queueEmpty(); + queueEmpty = true; } else if (!atTail) { @@ -1659,6 +1661,10 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener { sub.releaseSendLock(); } + if(queueEmpty) + { + sub.queueEmpty(); + } } // if there's (potentially) more than one subscription the others will potentially not have been advanced to the @@ -1860,7 +1866,7 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener } else { - //this subscription can accept additional deliveries, so we must + //this subscription can accept additional deliveries, so we must //keep going after this (if iteration slicing allows it) allSubscriptionsDone = false; lastLoop = false; |