Author: rajith
Date: Tue Jan 31 16:41:48 2012
New Revision: 1238688

URL: http://svn.apache.org/viewvc?rev=1238688&view=rev
Log:
QPID-3604 Moved the draining of consumer queues further down to be done
after we drain the dispatch queue. Since the message flow is now stopped
we can drain the queues without grabbing the message-delivery-lock.

Modified:
    
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java

Modified: 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java?rev=1238688&r1=1238687&r2=1238688&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
 (original)
+++ 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
 Tue Jan 31 16:41:48 2012
@@ -1366,18 +1366,16 @@ public class AMQSession_0_10 extends AMQ
     void stop() throws AMQException
     {
         super.stop();
-        synchronized (getMessageDeliveryLock())
-        {
-               for (BasicMessageConsumer consumer : getConsumers().values())
-               {
-                   List<Long> tags = 
consumer.drainReceiverQueueAndRetrieveDeliveryTags();
-                   getPrefetchedMessageTags().addAll(tags);
-               }
-        }
         setUsingDispatcherForCleanup(true);
         drainDispatchQueue();
         setUsingDispatcherForCleanup(false);
 
+        for (BasicMessageConsumer consumer : getConsumers().values())
+        {
+            List<Long> tags = 
consumer.drainReceiverQueueAndRetrieveDeliveryTags();
+            getPrefetchedMessageTags().addAll(tags);
+        }
+        
         RangeSet delivered = gatherRangeSet(getUnacknowledgedMessageTags());
                RangeSet prefetched = 
gatherRangeSet(getPrefetchedMessageTags());
                RangeSet all = RangeSetFactory.createRangeSet(delivered.size()



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to