diff options
| author | Alan Conway <aconway@apache.org> | 2013-02-07 19:25:53 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2013-02-07 19:25:53 +0000 |
| commit | 415e2d011a75374ad5757ff5b4d262228d143eb4 (patch) | |
| tree | 1926af4926e48abd6e592bd2b00c3d79ce9d63a6 /qpid/cpp | |
| parent | 731092dc89ad91f775c201a2feb09188442ccb8e (diff) | |
| download | qpid-python-415e2d011a75374ad5757ff5b4d262228d143eb4.tar.gz | |
QPID-4555: HA Don't shut down on deleting an exchange that is in use as an alternate.
Previously threw an exception in this case which shut down the broker.
Log warning instead, this is not a fatal event.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1443676 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/ha/BrokerReplicator.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp index 9ab6628e17..0f4c5b2be8 100644 --- a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp +++ b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp @@ -784,6 +784,15 @@ void BrokerReplicator::deleteQueue(const std::string& name, bool purge) { void BrokerReplicator::deleteExchange(const std::string& name) { try { + boost::shared_ptr<broker::Exchange> exchange = exchanges.find(name); + if (!exchange) { + QPID_LOG(warning, logPrefix << "Cannot delete exchange, not found: " << name); + return; + } + if (exchange->inUseAsAlternate()) { + QPID_LOG(warning, "Cannot delete exchange, in use as alternate: " << name); + return; + } broker.deleteExchange(name, userId, remoteHost); QPID_LOG(debug, logPrefix << "Exchange deleted: " << name); } catch (const framing::NotFoundException&) { |
