diff options
| author | Jonathan Robie <jonathan@apache.org> | 2011-01-13 20:54:03 +0000 |
|---|---|---|
| committer | Jonathan Robie <jonathan@apache.org> | 2011-01-13 20:54:03 +0000 |
| commit | 38723ee5b89df32d8d36dee1cb8c2826e5bfe8e9 (patch) | |
| tree | 260e9e22f30290891c57a855268fc0111f39edec /cpp/src/qpid/broker/TopicExchange.cpp | |
| parent | 9c16fa21baa3b48772ee1f46e7a14647a032248d (diff) | |
| download | qpid-python-38723ee5b89df32d8d36dee1cb8c2826e5bfe8e9.tar.gz | |
Fixes QPID-2499: Stale federation routes remain after route deletion.
Federated binds and unbinds need to know which federation origins
are associated with the bindings for each queue. When origins are
added or deleted, the corresponding bindings need to be
propagated.
fedBindings[queueName] contains the origins associated with the
given queue.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1058747 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/TopicExchange.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/TopicExchange.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/TopicExchange.cpp b/cpp/src/qpid/broker/TopicExchange.cpp index 6bc42e28bf..1b0fe71bcf 100644 --- a/cpp/src/qpid/broker/TopicExchange.cpp +++ b/cpp/src/qpid/broker/TopicExchange.cpp @@ -236,7 +236,7 @@ bool TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, cons for (q = qv.begin(); q != qv.end(); q++) { if ((*q)->queue == queue) { // already bound, but may be from a different fedOrigin - bk->fedBinding.addOrigin(fedOrigin); + bk->fedBinding.addOrigin(queue->getName(), fedOrigin); return false; } } @@ -245,7 +245,7 @@ bool TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, cons binding->startManagement(); bk->bindingVector.push_back(binding); nBindings++; - propagate = bk->fedBinding.addOrigin(fedOrigin); + propagate = bk->fedBinding.addOrigin(queue->getName(), fedOrigin); if (mgmtExchange != 0) { mgmtExchange->inc_bindingCount(); } @@ -258,8 +258,8 @@ bool TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, cons RWlock::ScopedWlock l(lock); BindingKey* bk = bindingTree.getBindingKey(routingPattern); if (bk) { - propagate = bk->fedBinding.delOrigin(fedOrigin); - reallyUnbind = bk->fedBinding.count() == 0; + propagate = bk->fedBinding.delOrigin(queue->getName(), fedOrigin); + reallyUnbind = bk->fedBinding.countFedBindings(queue->getName()) == 0; } } if (reallyUnbind) |
