summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Dispatcher.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-10-10 04:49:48 +0000
committerAlan Conway <aconway@apache.org>2008-10-10 04:49:48 +0000
commit5d07d177cfc5eca21c44981bbe342f0cdcced4e5 (patch)
tree0f5f83642ed5effed52a5e2547565362ce2aea8c /cpp/src/qpid/client/Dispatcher.cpp
parente7ceead683231ef2cb35a6ee70488e859f023d12 (diff)
downloadqpid-python-5d07d177cfc5eca21c44981bbe342f0cdcced4e5.tar.gz
QPID-1340 froM Mick Goulish: preliminary client-side failover support.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@703319 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/Dispatcher.cpp')
-rw-r--r--cpp/src/qpid/client/Dispatcher.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/Dispatcher.cpp b/cpp/src/qpid/client/Dispatcher.cpp
index 5028d68405..08905bc96c 100644
--- a/cpp/src/qpid/client/Dispatcher.cpp
+++ b/cpp/src/qpid/client/Dispatcher.cpp
@@ -49,7 +49,10 @@ void Subscriber::received(Message& msg)
}
Dispatcher::Dispatcher(const Session& s, const std::string& q)
- : session(s), running(false), autoStop(true)
+ : session(s),
+ running(false),
+ autoStop(true),
+ failoverHandler(0)
{
queue = q.empty() ?
session.getExecution().getDemux().getDefault() :
@@ -91,9 +94,20 @@ void Dispatcher::run()
}
session.sync(); // Make sure all our acks are received before returning.
}
- catch (const ClosedException&) {} //ignore it and return
+ catch (const ClosedException& e)
+ {
+ QPID_LOG(debug, "Ignored exception in client dispatch thread: " << e.what());
+ } //ignore it and return
catch (const std::exception& e) {
QPID_LOG(error, "Exception in client dispatch thread: " << e.what());
+ if ( failoverHandler )
+ {
+ failoverHandler();
+ }
+ else
+ {
+ QPID_LOG(info, "No dispatcher failover handler registered.");
+ }
}
}