Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
#include <SubscriptionImpl.h>
Inherits qpid::client::MessageListener.
Public Member Functions | |
SubscriptionImpl (SubscriptionManager &, const std::string &queue, const SubscriptionSettings &, const std::string &name, MessageListener *=0) | |
std::string | getName () const |
The name of the subsctription, used as the "destination" for messages from the broker. | |
std::string | getQueue () const |
Name of the queue this subscription subscribes to. | |
const SubscriptionSettings & | getSettings () const |
Get the flow control and acknowledgement settings for this subscription. | |
void | setFlowControl (const FlowControl &) |
Set the flow control parameters. | |
void | setAutoAck (size_t n) |
Automatically acknowledge (acquire and accept) batches of n messages. | |
SequenceSet | getUnacquired () const |
Get the set of ID's for messages received by this subscription but not yet acquired. | |
SequenceSet | getUnaccepted () const |
Get the set of ID's for messages acquired by this subscription but not yet accepted. | |
void | acquire (const SequenceSet &messageIds) |
Acquire messageIds and remove them from the un-acquired set for the session. | |
void | accept (const SequenceSet &messageIds) |
Accept messageIds and remove them from the un-accepted set for the session. | |
void | release (const SequenceSet &messageIds) |
Release messageIds and remove them from the un-accepted set for the session. | |
Session | getSession () const |
Get the session associated with this subscription. | |
SubscriptionManager & | getSubscriptionManager () const |
Get the subscription manager associated with this subscription. | |
void | subscribe () |
Send subscription request and issue appropriate flow control commands. | |
void | cancel () |
Cancel the subscription. | |
void | grantCredit (framing::message::CreditUnit unit, uint32_t value) |
Grant specified credit for this subscription. | |
void | received (Message &) |
Called for each message arriving from the broker. | |
Demux::QueuePtr | divert () |
Set up demux diversion for messages sent to this subscription. | |
void | cancelDiversion () |
Cancel any demux diversion that may have been setup for this subscription. |
Definition at line 40 of file SubscriptionImpl.h.
qpid::client::SubscriptionImpl::SubscriptionImpl | ( | SubscriptionManager & | , | |
const std::string & | queue, | |||
const SubscriptionSettings & | , | |||
const std::string & | name, | |||
MessageListener * | = 0 | |||
) |
void qpid::client::SubscriptionImpl::accept | ( | const SequenceSet & | messageIds | ) |
Accept messageIds and remove them from the un-accepted set for the session.
void qpid::client::SubscriptionImpl::acquire | ( | const SequenceSet & | messageIds | ) |
Acquire messageIds and remove them from the un-acquired set for the session.
void qpid::client::SubscriptionImpl::cancel | ( | ) |
Cancel the subscription.
void qpid::client::SubscriptionImpl::cancelDiversion | ( | ) |
Cancel any demux diversion that may have been setup for this subscription.
Demux::QueuePtr qpid::client::SubscriptionImpl::divert | ( | ) |
Set up demux diversion for messages sent to this subscription.
std::string qpid::client::SubscriptionImpl::getName | ( | ) | const |
The name of the subsctription, used as the "destination" for messages from the broker.
Usually the same as the queue name but can be set differently.
std::string qpid::client::SubscriptionImpl::getQueue | ( | ) | const |
Name of the queue this subscription subscribes to.
Session qpid::client::SubscriptionImpl::getSession | ( | ) | const |
Get the session associated with this subscription.
const SubscriptionSettings& qpid::client::SubscriptionImpl::getSettings | ( | ) | const |
Get the flow control and acknowledgement settings for this subscription.
SubscriptionManager& qpid::client::SubscriptionImpl::getSubscriptionManager | ( | ) | const |
Get the subscription manager associated with this subscription.
SequenceSet qpid::client::SubscriptionImpl::getUnaccepted | ( | ) | const |
Get the set of ID's for messages acquired by this subscription but not yet accepted.
SequenceSet qpid::client::SubscriptionImpl::getUnacquired | ( | ) | const |
Get the set of ID's for messages received by this subscription but not yet acquired.
This will always be empty if acquireMode=ACQUIRE_MODE_PRE_ACQUIRED
void qpid::client::SubscriptionImpl::grantCredit | ( | framing::message::CreditUnit | unit, | |
uint32_t | value | |||
) |
Grant specified credit for this subscription.
void qpid::client::SubscriptionImpl::received | ( | Message & | ) | [virtual] |
Called for each message arriving from the broker.
Override in your own subclass to process messages.
Implements qpid::client::MessageListener.
void qpid::client::SubscriptionImpl::release | ( | const SequenceSet & | messageIds | ) |
Release messageIds and remove them from the un-accepted set for the session.
void qpid::client::SubscriptionImpl::setAutoAck | ( | size_t | n | ) |
void qpid::client::SubscriptionImpl::setFlowControl | ( | const FlowControl & | ) |
Set the flow control parameters.
void qpid::client::SubscriptionImpl::subscribe | ( | ) |
Send subscription request and issue appropriate flow control commands.