diff options
| author | Alan Conway <aconway@apache.org> | 2011-06-30 11:54:40 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2011-06-30 11:54:40 +0000 |
| commit | f48c4890e25c3cd76b7534cfca56e40ee30eb7ca (patch) | |
| tree | 634818c1622cb0d26595acb07f6babbb4d09c716 /cpp/src/qpid/client | |
| parent | 716aefd07695b84a869c40400b648bc1adf54cc4 (diff) | |
| download | qpid-python-f48c4890e25c3cd76b7534cfca56e40ee30eb7ca.tar.gz | |
QPID-3329: Configure C++ client connections to replace url-addresses rather than merging new addresses with old
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1141493 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client')
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp | 5 | ||||
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/ConnectionImpl.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp index 473f5ecd1c..ced8cf66fd 100644 --- a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp @@ -64,7 +64,7 @@ std::string asString(const std::vector<std::string>& v) { } ConnectionImpl::ConnectionImpl(const std::string& url, const Variant::Map& options) : - reconnect(false), timeout(-1), limit(-1), + replaceUrls(false), reconnect(false), timeout(-1), limit(-1), minReconnectInterval(3), maxReconnectInterval(60), retries(0), reconnectOnLimitExceeded(true) { @@ -95,7 +95,10 @@ void ConnectionImpl::setOption(const std::string& name, const Variant& value) minReconnectInterval = value; } else if (name == "reconnect-interval-max" || name == "reconnect_interval_max") { maxReconnectInterval = value; + } else if (name == "reconnect-urls-replace" || name == "reconnect_urls_replace") { + replaceUrls = value.asBool(); } else if (name == "reconnect-urls" || name == "reconnect_urls") { + if (replaceUrls) urls.clear(); if (value.getType() == VAR_LIST) { merge(value.asList(), urls); } else { diff --git a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h index 9e31238bc1..1b58cbbe3e 100644 --- a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h +++ b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h @@ -60,6 +60,7 @@ class ConnectionImpl : public qpid::messaging::ConnectionImpl qpid::sys::Semaphore semaphore;//used to coordinate reconnection Sessions sessions; qpid::client::Connection connection; + bool replaceUrls; // Replace rather than merging with reconnect-urls std::vector<std::string> urls; qpid::client::ConnectionSettings settings; bool reconnect; |
