summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2010-01-28 16:52:38 +0000
committerKim van der Riet <kpvdr@apache.org>2010-01-28 16:52:38 +0000
commitb862462df1b77c69a0688d7197947d780c36eab0 (patch)
treeeef3db133b1a1ed13b608283a1788b9851a1984a
parentf39a947903420da8022ee52dddbc6ad11c4f6def (diff)
downloadqpid-python-b862462df1b77c69a0688d7197947d780c36eab0.tar.gz
Fix for QPID-2373 - Durable exchange state not replicated to broker joining cluster
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@904154 13f79535-47bb-0310-9956-ffa450edef68
-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());
}