|
RMQ - RabbitMQ C++ Library
|
Controls acknowledgements passed to broker for consumed messages. More...
#include <rmqa_tracingmessageguard.h>


Classes | |
| class | Factory |
Public Types | |
| typedef bsl::function< void(const rmqt::ConsumerAck &)> | MessageGuardCallback |
Public Member Functions | |
| rmqp::TransferrableMessageGuard | transferOwnership () BSLS_KEYWORD_OVERRIDE |
| TracingMessageGuard (const rmqt::Message &message, const rmqt::Envelope &envelope, const MessageGuardCallback &ackCallback, rmqp::Consumer *consumer, const bsl::string &queueName, const bsl::shared_ptr< const rmqt::Endpoint > &endpoint, const bsl::shared_ptr< rmqp::ConsumerTracing > &contextFactory) | |
| TracingMessageGuard (const TracingMessageGuard &obj) | |
| const rmqt::Message & | message () const BSLS_KEYWORD_OVERRIDE |
| Access the received message. More... | |
| const rmqt::Envelope & | envelope () const BSLS_KEYWORD_OVERRIDE |
| Access the received message envelope (delivery details) More... | |
| void | ack () BSLS_KEYWORD_OVERRIDE |
| void | nack (bool requeue=true) BSLS_KEYWORD_OVERRIDE |
| virtual rmqp::Consumer * | consumer () const BSLS_KEYWORD_OVERRIDE |
| Pointer to the Consumer, e.g. to cancel the message flow. More... | |
Protected Types | |
| enum | State { READY , TRANSFERRED , RESOLVED } |
Protected Member Functions | |
| State | state () const |
Controls acknowledgements passed to broker for consumed messages.
A TracingMessageGuard is passed to the rmqa::Consumer callback function (defined in rmqp::Consumer) for each message in the event that ConsumerTracing is enabled. The difference being that the ConsumerTracing context is created from the thread that will process the message callback, and the context will be bound to the messageGuard. The object allows acknowledging either positively or negatively, with options to requeue. If a MessageGuard object is allowed to destruct before ack/nack is called a nack with requeue is automatically signaled to the broker.
|
protectedinherited |
Ready - not resolved yet Invalid - ownership moved Resolved - message (n)acked.
| BloombergLP::rmqa::TracingMessageGuard::TracingMessageGuard | ( | const rmqt::Message & | message, |
| const rmqt::Envelope & | envelope, | ||
| const MessageGuardCallback & | ackCallback, | ||
| rmqp::Consumer * | consumer, | ||
| const bsl::string & | queueName, | ||
| const bsl::shared_ptr< const rmqt::Endpoint > & | endpoint, | ||
| const bsl::shared_ptr< rmqp::ConsumerTracing > & | contextFactory | ||
| ) |
Constructs a new valid guard
| message | Consumed message |
| envelope | Consumed delivery metadata |
| ackCallback | Callback called when resolving message |
| consumer | Pointer to the Consumer |
| BloombergLP::rmqa::TracingMessageGuard::TracingMessageGuard | ( | const TracingMessageGuard & | obj | ) |
During copying obj is invalidated and thereafter cannot be used to (n)ack.
|
virtualinherited |
Acknowledge the received message. Callable only once. Should only be called after the message has been fully processed
A message acknowledgement is fire-and-forget. If the broker does not receive this (e.g. due to connection drop), the message will be redelivered to another consumer.
Implements BloombergLP::rmqp::MessageGuard.
|
virtualinherited |
Pointer to the Consumer, e.g. to cancel the message flow.
Implements BloombergLP::rmqp::MessageGuard.
|
virtualinherited |
Access the received message envelope (delivery details)
Implements BloombergLP::rmqp::MessageGuard.
|
virtualinherited |
Access the received message.
Implements BloombergLP::rmqp::MessageGuard.
|
virtualinherited |
Negative acknowledge the received message. Callable only once.
| requeue | true requeues the message on the broker for redelivery , if false, then the message will be either dead lettered (if a dead letter exchange is specified) or dropped if not. |
Implements BloombergLP::rmqp::MessageGuard.
|
virtual |
Transfers ownership of the message processing to a MessageGuard that is copyable (shared pointer semantics) RETURN a shared pointer to a valid message guard,
Reimplemented from BloombergLP::rmqa::MessageGuard.