You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2010/03/18 16:05:05 UTC

svn commit: r924846 - in /qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue: ExchangeBinding.java ExchangeBindings.java SimpleAMQQueue.java

Author: robbie
Date: Thu Mar 18 15:05:04 2010
New Revision: 924846

URL: http://svn.apache.org/viewvc?rev=924846&view=rev
Log:
QPID-2449: when SAMQQ.delete() is called and associated bindings are unregistered, also check if the binding is durable and if so then  remove it from the store too

Modified:
    qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java
    qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java
    qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java

Modified: qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java?rev=924846&r1=924845&r2=924846&view=diff
==============================================================================
--- qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java (original)
+++ qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java Thu Mar 18 15:05:04 2010
@@ -25,6 +25,7 @@ import org.apache.qpid.server.logging.ac
 import org.apache.qpid.server.logging.messages.BindingMessages;
 import org.apache.qpid.server.logging.subjects.BindingLogSubject;
 import org.apache.qpid.server.logging.LogSubject;
+import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.AMQException;
@@ -50,9 +51,13 @@ public class ExchangeBinding
 
 
 
-    void unbind(AMQQueue queue) throws AMQException
+    void unbind(AMQQueue queue, VirtualHost vhost) throws AMQException
     {
         _exchange.deregisterQueue(_routingKey, queue, _arguments);
+        if (queue.isDurable() && _exchange.isDurable())
+        {
+            vhost.getMessageStore().unbindQueue(_exchange, _routingKey, queue, _arguments);
+        }
 
         CurrentActor.get().message(_logSubject, BindingMessages.BND_DELETED());
     }

Modified: qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java?rev=924846&r1=924845&r2=924846&view=diff
==============================================================================
--- qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java (original)
+++ qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java Thu Mar 18 15:05:04 2010
@@ -28,6 +28,7 @@ import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.server.exchange.Exchange;
+import org.apache.qpid.server.virtualhost.VirtualHost;
 
 /**
  * When a queue is deleted, it should be deregistered from any
@@ -65,13 +66,13 @@ class ExchangeBindings
     /**
      * Deregisters this queue from any exchange it has been bound to
      */
-    void deregister() throws AMQException
+    void deregister(VirtualHost vhost) throws AMQException
     {
         //remove duplicates at this point
         HashSet<ExchangeBinding> copy = new HashSet<ExchangeBinding>(_bindings);
         for (ExchangeBinding b : copy)
         {
-            b.unbind(_queue);
+            b.unbind(_queue, vhost);
         }
     }
 

Modified: qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java?rev=924846&r1=924845&r2=924846&view=diff
==============================================================================
--- qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java (original)
+++ qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java Thu Mar 18 15:05:04 2010
@@ -1123,7 +1123,7 @@ public class SimpleAMQQueue implements A
                 }
             }
 
-            _bindings.deregister();
+            _bindings.deregister(_virtualHost);
             _virtualHost.getQueueRegistry().unregisterQueue(_name);
 
             _managedObject.unregister();



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org