You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2008/03/14 12:39:21 UTC

svn commit: r637067 - /incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java

Author: ritchiem
Date: Fri Mar 14 04:39:20 2008
New Revision: 637067

URL: http://svn.apache.org/viewvc?rev=637067&view=rev
Log:
QPID-852 : Updated broker so that it closes consumers when there are no messages on the queue

Modified:
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java

Modified: incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java?rev=637067&r1=637066&r2=637067&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java (original)
+++ incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java Fri Mar 14 04:39:20 2008
@@ -349,7 +349,14 @@
         return tag;
     }
 
-    public void unsubscribeConsumer(AMQProtocolSession session, AMQShortString consumerTag) throws AMQException
+    /**
+     * Unsubscribe a consumer from a queue.
+     * @param session
+     * @param consumerTag
+     * @return true if the consumerTag had a mapped queue that could be unregistered.
+     * @throws AMQException
+     */
+    public boolean unsubscribeConsumer(AMQProtocolSession session, AMQShortString consumerTag) throws AMQException
     {
         if (_log.isDebugEnabled())
         {
@@ -374,7 +381,9 @@
         if (q != null)
         {
             q.unregisterProtocolSession(session, _channelId, consumerTag);
+            return true;
         }
+        return false;
     }
 
     /**