diff options
| author | Alan Conway <aconway@apache.org> | 2013-04-29 15:57:59 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2013-04-29 15:57:59 +0000 |
| commit | 1d9f1a0bb5892c4ce289355f276682029a3d6ca0 (patch) | |
| tree | 2124944807ddfde7baf7cfc96e92e4033e432a24 /cpp/src/qpid/ha/StatusCheck.cpp | |
| parent | 793a8dd85e7e4fc5f833b73d1713b18e70ebede8 (diff) | |
| download | qpid-python-1d9f1a0bb5892c4ce289355f276682029a3d6ca0.tar.gz | |
QPID-4787: HA brokers find self-address in brokers_url.
HA brokers need to know their own addresses, but it is not safe to simply use
local hosts name and Broker::getPort() since the broker may be listening on
multiple addresses. The solution is to have brokers check the ha-rokers-url for
their own address while doing the initial status check of the cluster.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1477165 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/ha/StatusCheck.cpp')
| -rw-r--r-- | cpp/src/qpid/ha/StatusCheck.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/ha/StatusCheck.cpp b/cpp/src/qpid/ha/StatusCheck.cpp index 2921b9ec55..e56efc5873 100644 --- a/cpp/src/qpid/ha/StatusCheck.cpp +++ b/cpp/src/qpid/ha/StatusCheck.cpp @@ -19,6 +19,7 @@ * */ #include "StatusCheck.h" +#include "ConnectionObserver.h" #include "qpid/log/Statement.h" #include "qpid/messaging/Address.h" #include "qpid/messaging/Connection.h" @@ -55,7 +56,9 @@ void StatusCheckThread::run() { try { Variant::Map options, clientProperties; clientProperties = brokerInfo.asMap(); // Detect self connections. - clientProperties["qpid.ha-admin"] = 1; // Allow connection to backups. + clientProperties[ConnectionObserver::ADMIN_TAG] = 1; // Allow connection to backups. + clientProperties[ConnectionObserver::ADDRESS_TAG] = url.str(); + clientProperties[ConnectionObserver::BACKUP_TAG] = brokerInfo.asMap(); options["client-properties"] = clientProperties; options["heartbeat"] = statusCheck.linkHeartbeatInterval/sys::TIME_SEC; |
