| Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
#include <qmf/engine/ResilientConnection.h>
Public Member Functions | |
| ResilientConnection (const ConnectionSettings &settings) | |
| Create a new resilient connection. | |
| ~ResilientConnection () | |
| bool | isConnected () const |
| Get the connected status of the resilient connection. | |
| bool | getEvent (ResilientConnectionEvent &event) |
| Get the next event (if present) from the connection. | |
| void | popEvent () |
| Discard the event on the front of the queue. | |
| bool | createSession (const char *name, void *sessionContext, SessionHandle &handle) |
| Create a new AMQP session. | |
| void | destroySession (SessionHandle handle) |
| Destroy a created session. | |
| void | sendMessage (SessionHandle handle, Message &message) |
| Send a message into the AMQP broker via a session. | |
| void | declareQueue (SessionHandle handle, char *queue) |
| Declare an exclusive, auto-delete queue for a session. | |
| void | deleteQueue (SessionHandle handle, char *queue) |
| Delete a queue. | |
| void | bind (SessionHandle handle, char *exchange, char *queue, char *key) |
| Bind a queue to an exchange. | |
| void | unbind (SessionHandle handle, char *exchange, char *queue, char *key) |
| Remove a binding. | |
| void | setNotifyFd (int fd) |
| Establish a file descriptor for event notification. | |
| void | notify () |
| Send a byte into the notify file descriptor. | |
Upon creation, ResilientConnection attempts to establish a connection to the messaging broker. If it fails, it will continue to retry at an interval that increases over time (to a maximum interval). If an extablished connection is dropped, a reconnect will be attempted.
Definition at line 62 of file ResilientConnection.h.
| qmf::engine::ResilientConnection::ResilientConnection | ( | const ConnectionSettings & | settings | ) |
Create a new resilient connection.
| settings | Settings that define how the connection is to be made. | |
| delayMin | Minimum delay (in seconds) between retries. | |
| delayMax | Maximum delay (in seconds) between retries. | |
| delayFactor | Factor to multiply retry delay by after each failure. |
| qmf::engine::ResilientConnection::~ResilientConnection | ( | ) |
| void qmf::engine::ResilientConnection::bind | ( | SessionHandle | handle, | |
| char * | exchange, | |||
| char * | queue, | |||
| char * | key | |||
| ) |
Bind a queue to an exchange.
| handle | The session handle of the session to use for binding. | |
| exchange | The name of the exchange for binding. | |
| queue | The name of the queue for binding. | |
| key | The binding key. |
| bool qmf::engine::ResilientConnection::createSession | ( | const char * | name, | |
| void * | sessionContext, | |||
| SessionHandle & | handle | |||
| ) |
Create a new AMQP session.
| name | Unique name for the session. | |
| sessionContext | Optional user-context value that will be provided in events pertaining to this session. | |
| handle | Output handle to be stored and used in subsequent calls pertaining to this session. |
| void qmf::engine::ResilientConnection::declareQueue | ( | SessionHandle | handle, | |
| char * | queue | |||
| ) |
Declare an exclusive, auto-delete queue for a session.
| handle | The session handle for the owner of the queue. | |
| queue | The name of the queue. |
| void qmf::engine::ResilientConnection::deleteQueue | ( | SessionHandle | handle, | |
| char * | queue | |||
| ) |
Delete a queue.
| handle | The session handle for the owner of the queue. | |
| queue | The name of the queue. |
| void qmf::engine::ResilientConnection::destroySession | ( | SessionHandle | handle | ) |
| bool qmf::engine::ResilientConnection::getEvent | ( | ResilientConnectionEvent & | event | ) |
Get the next event (if present) from the connection.
| event | Returned event if one is available. |
| bool qmf::engine::ResilientConnection::isConnected | ( | ) | const |
Get the connected status of the resilient connection.
| void qmf::engine::ResilientConnection::notify | ( | ) |
Send a byte into the notify file descriptor.
This can be used to wake up the event processing portion of the engine from either the wrapped implementation or the engine itself.
| void qmf::engine::ResilientConnection::popEvent | ( | ) |
Discard the event on the front of the queue.
This should be invoked after processing the event from getEvent.
| void qmf::engine::ResilientConnection::sendMessage | ( | SessionHandle | handle, | |
| Message & | message | |||
| ) |
Send a message into the AMQP broker via a session.
| handle | The session handle of the session to transmit through. | |
| message | The QMF message to transmit. |
| void qmf::engine::ResilientConnection::setNotifyFd | ( | int | fd | ) |
Establish a file descriptor for event notification.
| fd | A file descriptor into which the connection shall write a character each time an event is enqueued. This fd may be in a pair, the other fd of which is used in a select loop to control execution. |
| void qmf::engine::ResilientConnection::unbind | ( | SessionHandle | handle, | |
| char * | exchange, | |||
| char * | queue, | |||
| char * | key | |||
| ) |
Remove a binding.
| handle | The session handle of the session to use for un-binding. | |
| exchange | The name of the exchange. | |
| queue | The name of the queue. | |
| key | The binding key. |
1.4.7