summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/broker/ExchangeRegistry.cpp3
-rw-r--r--cpp/src/qpid/cluster/Connection.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/ExchangeRegistry.cpp b/cpp/src/qpid/broker/ExchangeRegistry.cpp
index 951cdbd395..f4a860fa1e 100644
--- a/cpp/src/qpid/broker/ExchangeRegistry.cpp
+++ b/cpp/src/qpid/broker/ExchangeRegistry.cpp
@@ -54,8 +54,7 @@ pair<Exchange::shared_ptr, bool> ExchangeRegistry::declare(const string& name, c
exchange = Exchange::shared_ptr(new HeadersExchange(name, durable, args, parent, broker));
}else if (type == ManagementExchange::typeName) {
exchange = Exchange::shared_ptr(new ManagementExchange(name, durable, args, parent, broker));
- }
- else{
+ }else{
FunctionMap::iterator i = factory.find(type);
if (i == factory.end()) {
throw UnknownExchangeTypeException();
diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp
index 1c6be4e862..3f37d63255 100644
--- a/cpp/src/qpid/cluster/Connection.cpp
+++ b/cpp/src/qpid/cluster/Connection.cpp
@@ -477,6 +477,9 @@ void Connection::accumulatedAck(const qpid::framing::SequenceSet& s) {
void Connection::exchange(const std::string& encoded) {
Buffer buf(const_cast<char*>(encoded.data()), encoded.size());
broker::Exchange::shared_ptr ex = broker::Exchange::decode(cluster.getBroker().getExchanges(), buf);
+ if(ex.get() && ex->isDurable() && !ex->getName().find("amq.") == 0 && !ex->getName().find("qpid.") == 0) {
+ cluster.getBroker().getStore().create(*(ex.get()), ex->getArgs());
+ }
QPID_LOG(debug, cluster << " updated exchange " << ex->getName());
}