Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
Utility to manage failover. More...
#include <qpid/client/FailoverManager.h>
Classes | |
struct | Command |
Interface to implement for doing work that can be resumed on failover. More... | |
struct | ReconnectionStrategy |
Public Member Functions | |
FailoverManager (const ConnectionSettings &settings, ReconnectionStrategy *strategy=0) | |
Create a manager to control failover for a logical connection. | |
Connection & | connect (std::vector< Url > brokers=std::vector< Url >()) |
Return the current connection if open or attept to reconnect to the specified list of urls. | |
Connection & | getConnection () |
Return the current connection whether open or not. | |
void | close () |
Close the current connection. | |
void | execute (Command &) |
Reliably execute the specified command. |
Utility to manage failover.
Definition at line 45 of file FailoverManager.h.
qpid::client::FailoverManager::FailoverManager | ( | const ConnectionSettings & | settings, | |
ReconnectionStrategy * | strategy = 0 | |||
) |
Create a manager to control failover for a logical connection.
settings | the initial connection settings | |
strategy | optional stratgey callback allowing application to edit or reorder the list of urls to which reconnection is attempted |
void qpid::client::FailoverManager::close | ( | ) |
Close the current connection.
Connection& qpid::client::FailoverManager::connect | ( | std::vector< Url > | brokers = std::vector< Url >() |
) |
Return the current connection if open or attept to reconnect to the specified list of urls.
If no list is specified the list of known brokers from the last connection will be used. If no list is specified and this is the first connect attempt, the host and port from the initial settings will be used.
If the full list is tried and all attempts fail, CannotConnectException is thrown.
void qpid::client::FailoverManager::execute | ( | Command & | ) |
Reliably execute the specified command.
This involves creating a session on which to carry out the work of the command, handling failover occuring while exeuting that command and re-starting the work.
Multiple concurrent threads can call execute with different commands; each thread will be allocated its own session. FailoverManager will coordinate the different threads on failover to ensure they continue to use the same logical connection.
Connection& qpid::client::FailoverManager::getConnection | ( | ) |
Return the current connection whether open or not.