From 5dd3cd3ae035673bf6003b6422712663ffa57fe5 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 5 Feb 2010 23:02:45 +0000 Subject: Consistent connection names across a cluster. - use the same host:port for connections and their shadows. - add shadow property to managment connection to identify shadows. - updated qpid-stat and qpid-cluster to filter on shadow property. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@907123 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/UpdateClient.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/cluster/UpdateClient.cpp') diff --git a/cpp/src/qpid/cluster/UpdateClient.cpp b/cpp/src/qpid/cluster/UpdateClient.cpp index 36efdfba65..17d856b79c 100644 --- a/cpp/src/qpid/cluster/UpdateClient.cpp +++ b/cpp/src/qpid/cluster/UpdateClient.cpp @@ -57,6 +57,7 @@ #include #include #include +#include namespace qpid { namespace cluster { @@ -148,7 +149,7 @@ void UpdateClient::update() { ClusterConnectionProxy(session).expiryId(expiry.getId()); updateManagementAgent(); - + ClusterConnectionMembershipBody membership; map.toMethodBody(membership); AMQFrame frame(membership); @@ -328,6 +329,14 @@ void UpdateClient::updateOutputTask(const sys::OutputTask* task) { void UpdateClient::updateConnection(const boost::intrusive_ptr& updateConnection) { QPID_LOG(debug, updaterId << " updating connection " << *updateConnection); + + // Send the management ID first on the main connection. + std::string mgmtId = updateConnection->getBrokerConnection().getMgmtId(); + ClusterConnectionProxy(session).shadowPrepare(mgmtId); + // Make sure its received before opening shadow connection + session.sync(); + + // Open shadow connection and update it. shadowConnection = catchUpConnection(); broker::Connection& bc = updateConnection->getBrokerConnection(); @@ -341,6 +350,7 @@ void UpdateClient::updateConnection(const boost::intrusive_ptr& upda ClusterConnectionProxy(shadowConnection).shadowReady( updateConnection->getId().getMember(), updateConnection->getId().getNumber(), + bc.getMgmtId(), bc.getUserId(), string(fragment.first, fragment.second), updateConnection->getOutput().getSendMax() -- cgit v1.2.1