qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1133942 - in /qpid/trunk/qpid/cpp/src: qpid/broker/HeadersExchange.cpp tests/federation.py
Date Thu, 09 Jun 2011 15:35:36 GMT
Author: gsim
Date: Thu Jun  9 15:35:35 2011
New Revision: 1133942

URL: http://svn.apache.org/viewvc?rev=1133942&view=rev
Log:
QPID-3298: don't include the internal federation related args in the biding for headers exchange

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp
    qpid/trunk/qpid/cpp/src/tests/federation.py

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp?rev=1133942&r1=1133941&r2=1133942&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp Thu Jun  9 15:35:35 2011
@@ -112,9 +112,14 @@ bool HeadersExchange::bind(Queue::shared
 
         {
             Mutex::ScopedLock l(lock);
-            Binding::shared_ptr binding (new Binding (bindingKey, queue, this, *args));
+            //NOTE: do not include the fed op/tags/origin in the
+            //arguments as when x-match is 'all' these would prevent
+            //matching (they are internally added properties
+            //controlling binding propagation but not relevant to
+            //actual routing)
+            Binding::shared_ptr binding (new Binding (bindingKey, queue, this, extra_args));
             BoundKey bk(binding);
-            if (bindings.add_unless(bk, MatchArgs(queue, args))) {
+            if (bindings.add_unless(bk, MatchArgs(queue, &extra_args))) {
                 binding->startManagement();
                 propagate = bk.fedBinding.addOrigin(queue->getName(), fedOrigin);
                 if (mgmtExchange != 0) {

Modified: qpid/trunk/qpid/cpp/src/tests/federation.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/federation.py?rev=1133942&r1=1133941&r2=1133942&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/federation.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/federation.py Thu Jun  9 15:35:35 2011
@@ -649,10 +649,17 @@ class FederationTests(TestBase010):
 
         self.verify_cleanup()
 
-    def test_dynamic_headers(self):
+    def test_dynamic_headers_any(self):
+        self.do_test_dynamic_headers('any')
+
+    def test_dynamic_headers_all(self):
+        self.do_test_dynamic_headers('all')
+
+
+    def do_test_dynamic_headers(self, match_mode):
         session = self.session
         r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
-        r_session = r_conn.session("test_dynamic_headers")
+        r_session = r_conn.session("test_dynamic_headers_%s" % match_mode)
 
         session.exchange_declare(exchange="fed.headers", type="headers")
         r_session.exchange_declare(exchange="fed.headers", type="headers")
@@ -671,7 +678,7 @@ class FederationTests(TestBase010):
         sleep(5)
 
         session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
-        session.exchange_bind(queue="fed1", exchange="fed.headers", binding_key="key1", arguments={'x-match':'any',
'class':'first'})
+        session.exchange_bind(queue="fed1", exchange="fed.headers", binding_key="key1", arguments={'x-match':match_mode,
'class':'first'})
         self.subscribe(queue="fed1", destination="f1")
         queue = session.incoming("f1")
 



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


Mime
View raw message