diff options
| author | Alan Conway <aconway@apache.org> | 2008-10-17 16:45:24 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-10-17 16:45:24 +0000 |
| commit | 7db0c0970eac260626263314c30f0e20d4ef6c21 (patch) | |
| tree | 231024436b5b7185f63972d90318acce97816c22 /cpp/src/qpid/client/FailoverSession.cpp | |
| parent | a039e57108ed06586e73a255dc824ed27fc6de2a (diff) | |
| download | qpid-python-7db0c0970eac260626263314c30f0e20d4ef6c21.tar.gz | |
QPID-1367 Mick Goulish: improvements to client-side failover.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@705668 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/FailoverSession.cpp')
| -rw-r--r-- | cpp/src/qpid/client/FailoverSession.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/cpp/src/qpid/client/FailoverSession.cpp b/cpp/src/qpid/client/FailoverSession.cpp index a088a8c91b..25867c2a24 100644 --- a/cpp/src/qpid/client/FailoverSession.cpp +++ b/cpp/src/qpid/client/FailoverSession.cpp @@ -38,7 +38,7 @@ namespace qpid { namespace client { FailoverSession::FailoverSession ( ) : - name("no_name") + failover_in_progress(false) { // The session is created by FailoverConnection::newSession failoverSubscriptionManager = 0; @@ -170,11 +170,26 @@ FailoverSession::messageTransfer ( const string& destination, ) { - session.messageTransfer ( destination, - acceptMode, - acquireMode, - content - ); + while ( 1 ) + { + try + { + session.messageTransfer ( destination, + acceptMode, + acquireMode, + content + ); + break; + } + catch ( ... ) + { + // Take special action only if there is a failover in progress. + if ( ! failover_in_progress ) + break; + + usleep ( 1000 ); + } + } } @@ -583,7 +598,6 @@ FailoverSession::prepareForFailover ( Connection newConnection ) if ( failoverSubscriptionManager ) { - // failoverSubscriptionManager->prepareForFailover ( newSession ); } } |
