summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/UpdateClient.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-02-05 23:02:45 +0000
committerAlan Conway <aconway@apache.org>2010-02-05 23:02:45 +0000
commit5dd3cd3ae035673bf6003b6422712663ffa57fe5 (patch)
tree0fd603d1e693b5c75ff41a86ed0051b04fa99f02 /cpp/src/qpid/cluster/UpdateClient.cpp
parentf5408c46da630d308f6e2a80b8b228cd398b89b4 (diff)
downloadqpid-python-5dd3cd3ae035673bf6003b6422712663ffa57fe5.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/cluster/UpdateClient.cpp')
-rw-r--r--cpp/src/qpid/cluster/UpdateClient.cpp12
1 files changed, 11 insertions, 1 deletions
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 <boost/bind.hpp>
#include <boost/cast.hpp>
#include <algorithm>
+#include <sstream>
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<Connection>& 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<Connection>& upda
ClusterConnectionProxy(shadowConnection).shadowReady(
updateConnection->getId().getMember(),
updateConnection->getId().getNumber(),
+ bc.getMgmtId(),
bc.getUserId(),
string(fragment.first, fragment.second),
updateConnection->getOutput().getSendMax()