summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/DumpClient.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-09-18 20:18:29 +0000
committerAlan Conway <aconway@apache.org>2008-09-18 20:18:29 +0000
commitb210ae04b88afa38238ca56e474ca60533f2768b (patch)
tree9caa01a04713bcc33a1a3b7cbbb4e84e96232713 /cpp/src/qpid/cluster/DumpClient.cpp
parentaedf627380016ebf210ea88029be8bd338ffc989 (diff)
downloadqpid-python-b210ae04b88afa38238ca56e474ca60533f2768b.tar.gz
Dump shared state to new cluster members.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@696788 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/DumpClient.cpp')
-rw-r--r--cpp/src/qpid/cluster/DumpClient.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/DumpClient.cpp b/cpp/src/qpid/cluster/DumpClient.cpp
index f76a55c0d3..43c30d3b07 100644
--- a/cpp/src/qpid/cluster/DumpClient.cpp
+++ b/cpp/src/qpid/cluster/DumpClient.cpp
@@ -27,12 +27,21 @@
#include "qpid/broker/Exchange.h"
#include "qpid/broker/ExchangeRegistry.h"
#include "qpid/framing/MessageTransferBody.h"
+#include "qpid/framing/ClusterConnectionDumpCompleteBody.h"
#include "qpid/framing/enum.h"
+#include "qpid/framing/ProtocolVersion.h"
#include "qpid/log/Statement.h"
#include "qpid/Url.h"
#include <boost/bind.hpp>
namespace qpid {
+
+namespace client {
+struct ConnectionAccess {
+ static void setVersion(Connection& c, const framing::ProtocolVersion& v) { c.version = v; }
+};
+} // namespace client
+
namespace cluster {
using broker::Broker;
@@ -40,16 +49,18 @@ using broker::Exchange;
using broker::Queue;
using broker::QueueBinding;
using broker::Message;
+using namespace framing;
using namespace framing::message;
-
using namespace client;
+
DumpClient::DumpClient(const Url& url, Broker& b,
const boost::function<void()>& ok,
const boost::function<void(const std::exception&)>& fail)
: donor(b), done(ok), failed(fail)
{
- // FIXME aconway 2008-09-16: Identify as DumpClient connection.
+ // Special version identifies this as a catch-up connectionn.
+ client::ConnectionAccess::setVersion(connection, ProtocolVersion(0x80 , 0x80 + 10));
connection.open(url);
session = connection.newSession();
}
@@ -65,9 +76,10 @@ void DumpClient::dump() {
// Catch-up exchange is used to route messages to the proper queue without modifying routing key.
session.exchangeDeclare(arg::exchange=CATCH_UP, arg::type="fanout", arg::autoDelete=true);
donor.getQueues().eachQueue(boost::bind(&DumpClient::dumpQueue, this, _1));
+ SessionBase_0_10Access sb(session);
+ // FIXME aconway 2008-09-18: inidicate successful end-of-dump.
session.sync();
session.close();
- // FIXME aconway 2008-09-17: send dump complete indication.
connection.close();
}