#include <SubscriptionManager.h>
Public Member Functions | |
SubscriptionManager (Session &session) | |
Completion | subscribe (MessageListener &listener, const std::string &queue, const std::string &tag=std::string()) |
Subscribe a MessagesListener to receive messages from queue. | |
Completion | subscribe (LocalQueue &localQueue, const std::string &queue, const std::string &tag=std::string()) |
Subscribe a LocalQueue to receive messages from queue. | |
void | cancel (const std::string tag) |
Cancel a subscription. | |
void | run () |
Deliver messages until stop() is called. | |
void | setAutoStop (bool set=true) |
If set true, run() will stop when all subscriptions are cancelled. | |
void | stop () |
Cause run() to return. | |
void | setFlowControl (const std::string &tag, uint32_t messages, uint32_t bytes, bool window=true) |
Set the flow control for destination tag. | |
void | setFlowControl (uint32_t messages, uint32_t bytes, bool window=true) |
Set the initial flow control settings to be applied to each new subscribtion. | |
void | setAcceptMode (bool required) |
Set the accept-mode for new subscriptions. | |
void | setAcquireMode (bool acquire) |
Set the acquire-mode for new subscriptions. | |
void | setAckPolicy (const AckPolicy &autoAck) |
Set the acknowledgement policy for new subscriptions. | |
AckPolicy & | getAckPolicy () |
Static Public Attributes | |
static const uint32_t | UNLIMITED = 0xFFFFFFFF |
Completion qpid::client::SubscriptionManager::subscribe | ( | MessageListener & | listener, | |
const std::string & | queue, | |||
const std::string & | tag = std::string() | |||
) |
Subscribe a MessagesListener to receive messages from queue.
listener | Listener object to receive messages. | |
queue | Name of the queue to subscribe to. | |
tag | Unique destination tag for the listener. If not specified, the queue name is used. |
Completion qpid::client::SubscriptionManager::subscribe | ( | LocalQueue & | localQueue, | |
const std::string & | queue, | |||
const std::string & | tag = std::string() | |||
) |
Subscribe a LocalQueue to receive messages from queue.
queue | Name of the queue to subscribe to. | |
tag | Unique destination tag for the listener. If not specified, the queue name is used. |
void qpid::client::SubscriptionManager::cancel | ( | const std::string | tag | ) |
Cancel a subscription.
void qpid::client::SubscriptionManager::run | ( | ) | [virtual] |
void qpid::client::SubscriptionManager::setAutoStop | ( | bool | set = true |
) |
void qpid::client::SubscriptionManager::setFlowControl | ( | const std::string & | tag, | |
uint32_t | messages, | |||
uint32_t | bytes, | |||
bool | window = true | |||
) |
Set the flow control for destination tag.
tag,: | name of the destination. | |
messages,: | message credit. | |
bytes,: | byte credit. | |
window,: | if true use window-based flow control. |
void qpid::client::SubscriptionManager::setFlowControl | ( | uint32_t | messages, | |
uint32_t | bytes, | |||
bool | window = true | |||
) |
Set the initial flow control settings to be applied to each new subscribtion.
messages,: | message credit. | |
bytes,: | byte credit. | |
window,: | if true use window-based flow control. |
void qpid::client::SubscriptionManager::setAcceptMode | ( | bool | required | ) |
Set the accept-mode for new subscriptions.
Defaults to true.
required,: | if true messages must be confirmed by calling Message::acknowledge() or automatically, see setAckPolicy() |
void qpid::client::SubscriptionManager::setAcquireMode | ( | bool | acquire | ) |
Set the acquire-mode for new subscriptions.
Defaults to false.
acquire,: | if false messages pre-acquired, if true messages are dequed on acknowledgement or on transfer depending on acceptMode. |
void qpid::client::SubscriptionManager::setAckPolicy | ( | const AckPolicy & | autoAck | ) |
Set the acknowledgement policy for new subscriptions.
Default is to acknowledge every message automatically.