diff options
author | Alan Conway <aconway@apache.org> | 2008-09-15 19:39:22 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-09-15 19:39:22 +0000 |
commit | e60518c80a7ee6e96719a365d84b777aee59df4f (patch) | |
tree | ba4d2cc340b6497265df9624fb0385241a03b463 /cpp/src/qpid/cluster/DumpClient.cpp | |
parent | 6099da5735246f255eb62be535a2f462c7d3bab9 (diff) | |
download | qpid-python-e60518c80a7ee6e96719a365d84b777aee59df4f.tar.gz |
Cluster member stalling, cluster map updates and unit tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@695593 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/DumpClient.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/DumpClient.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/DumpClient.cpp b/cpp/src/qpid/cluster/DumpClient.cpp index 5b92552209..f20ceb2ab6 100644 --- a/cpp/src/qpid/cluster/DumpClient.cpp +++ b/cpp/src/qpid/cluster/DumpClient.cpp @@ -28,6 +28,7 @@ #include "qpid/broker/ExchangeRegistry.h" #include "qpid/framing/MessageTransferBody.h" #include "qpid/framing/enum.h" +#include "qpid/log/Statement.h" #include "qpid/Url.h" #include <boost/bind.hpp> @@ -43,7 +44,9 @@ using namespace framing::message; using namespace client; -DumpClient::DumpClient(const Url& url) { +DumpClient::DumpClient(const Url& url, Broker& b, const boost::function<void(const char*)>& f) + : donor(b), failed(f) +{ connection.open(url); session = connection.newSession(); } @@ -57,8 +60,7 @@ DumpClient::~DumpClient() { static const char CATCH_UP_CHARS[] = "\000qpid-dump-exchange"; static const std::string CATCH_UP(CATCH_UP_CHARS, sizeof(CATCH_UP_CHARS)); -void DumpClient::dump(Broker& donor) { - // TODO aconway 2008-09-08: Caller must handle exceptions +void DumpClient::dump() { // FIXME aconway 2008-09-08: send cluster map frame first. donor.getExchanges().eachExchange(boost::bind(&DumpClient::dumpExchange, this, _1)); // Catch-up exchange is used to route messages to the proper queue without modifying routing key. @@ -67,6 +69,15 @@ void DumpClient::dump(Broker& donor) { session.sync(); } +void DumpClient::run() { + try { + dump(); + } catch (const Exception& e) { + failed(e.what()); + } + delete this; +} + void DumpClient::dumpExchange(const boost::shared_ptr<Exchange>& ex) { session.exchangeDeclare( ex->getName(), ex->getType(), |