summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/BrokerAdapter.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-06-14 07:12:14 +0000
committerGordon Sim <gsim@apache.org>2007-06-14 07:12:14 +0000
commitb3747b9e1a5090a5eea0ac067b94d259f17ee09a (patch)
tree9e20e176532ccddac807c7302422c3c03ece2e54 /cpp/src/qpid/broker/BrokerAdapter.cpp
parent9f8a87e8fe1ac33935c816cf5fdc2c68aef3e556 (diff)
downloadqpid-python-b3747b9e1a5090a5eea0ac067b94d259f17ee09a.tar.gz
Add ability for a queue to record all bindings to it, such that these can be removed when the queue is deleted.
Fix to QPID-438 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@547151 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/BrokerAdapter.cpp')
-rw-r--r--cpp/src/qpid/broker/BrokerAdapter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/BrokerAdapter.cpp b/cpp/src/qpid/broker/BrokerAdapter.cpp
index 592995f10f..e099c4a56d 100644
--- a/cpp/src/qpid/broker/BrokerAdapter.cpp
+++ b/cpp/src/qpid/broker/BrokerAdapter.cpp
@@ -182,6 +182,7 @@ void BrokerAdapter::QueueHandlerImpl::declare(const MethodContext& context, uint
//add default binding:
broker.getExchanges().getDefault()->bind(queue, name, 0);
+ queue->bound(broker.getExchanges().getDefault()->getName(), name, arguments);
//handle automatic cleanup:
if (exclusive) {
@@ -212,8 +213,11 @@ void BrokerAdapter::QueueHandlerImpl::bind(const MethodContext& context, uint16_
Exchange::shared_ptr exchange = broker.getExchanges().get(exchangeName);
if(exchange){
string exchangeRoutingKey = routingKey.empty() && queueName.empty() ? queue->getName() : routingKey;
- if (exchange->bind(queue, exchangeRoutingKey, &arguments) && exchange->isDurable() && queue->isDurable()) {
- broker.getStore().bind(*exchange, *queue, routingKey, arguments);
+ if (exchange->bind(queue, exchangeRoutingKey, &arguments)) {
+ queue->bound(exchangeName, routingKey, arguments);
+ if (exchange->isDurable() && queue->isDurable()) {
+ broker.getStore().bind(*exchange, *queue, routingKey, arguments);
+ }
}
if(!nowait) client.bindOk(context.getRequestId());
}else{
@@ -269,6 +273,7 @@ void BrokerAdapter::QueueHandlerImpl::delete_(const MethodContext& context, uint
count = q->getMessageCount();
q->destroy();
broker.getQueues().destroy(queue);
+ q->unbind(broker.getExchanges(), q);
}
if(!nowait)