diff options
| author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-04-08 17:58:26 +0000 |
|---|---|---|
| committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-04-08 17:58:26 +0000 |
| commit | e14e59b567eca8b64a80c11ac1d767b4f6be4400 (patch) | |
| tree | 0ab03c420a93d90f35b22a27077e3573cfecf2f8 /cpp/src/qpid/broker/DirectExchange.cpp | |
| parent | e81fb19d56f25abbe928a4fbb5aa4f5505baccc8 (diff) | |
| download | qpid-python-e14e59b567eca8b64a80c11ac1d767b4f6be4400.tar.gz | |
QPID-2487: always save the origin, even if queue is already bound
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@932032 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/DirectExchange.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/DirectExchange.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/DirectExchange.cpp b/cpp/src/qpid/broker/DirectExchange.cpp index 05179502e6..1787c01af9 100644 --- a/cpp/src/qpid/broker/DirectExchange.cpp +++ b/cpp/src/qpid/broker/DirectExchange.cpp @@ -76,6 +76,9 @@ bool DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, con BoundKey& bk = bindings[routingKey]; if (exclusiveBinding) bk.queues.clear(); + QPID_LOG(debug, "Bind key [" << routingKey << "] to queue " << queue->getName() + << " (origin=" << fedOrigin << ")"); + if (bk.queues.add_unless(b, MatchQueue(queue))) { b->startManagement(); propagate = bk.fedBinding.addOrigin(fedOrigin); @@ -83,11 +86,17 @@ bool DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, con mgmtExchange->inc_bindingCount(); } } else { + // queue already present - still need to track fedOrigin + bk.fedBinding.addOrigin(fedOrigin); return false; } } else if (fedOp == fedOpUnbind) { Mutex::ScopedLock l(lock); BoundKey& bk = bindings[routingKey]; + + QPID_LOG(debug, "Bind - fedOpUnbind key [" << routingKey << "] queue " << queue->getName() + << " (origin=" << fedOrigin << ")"); + propagate = bk.fedBinding.delOrigin(fedOrigin); if (bk.fedBinding.count() == 0) unbind(queue, routingKey, 0); @@ -123,6 +132,8 @@ bool DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, c { bool propagate = false; + QPID_LOG(debug, "Unbind key [" << routingKey << "] from queue " << queue->getName()); + { Mutex::ScopedLock l(lock); BoundKey& bk = bindings[routingKey]; |
