|
RMQ - RabbitMQ C++ Library
|
Provide a RabbitMQ Async Consumer API. More...
#include <rmqp_consumer.h>

Public Types | |
| typedef bsl::function< void(rmqp::MessageGuard &)> | ConsumerFunc |
| Callback function used to receive messages. More... | |
Public Member Functions | |
| Consumer () | |
| Consumer is constructed from the Connection object. | |
| virtual rmqt::Future | cancel ()=0 |
| Cancels the consumer, stops new messages flowing in. More... | |
| virtual rmqt::Future | drain ()=0 |
| Can only be called (successfully) once the Consumer has been cancelled, returns a future which resolves when all outstanding acks have been sent to the server,. More... | |
| virtual rmqt::Result | cancelAndDrain (const bsls::TimeInterval &timeout)=0 |
| Tells the broker to stop delivering messages to this consumer. More... | |
| virtual rmqt::Future | updateTopologyAsync (const rmqt::TopologyUpdate &topologyUpdate)=0 |
| Updates topology. More... | |
Provide a RabbitMQ Async Consumer API.
Consumer represents a RabbitMQ consumer in a dedicated channel on the Connection. The Consumer::Consumer implementation passed to Connection::createConsumer is invoked on each message sent by the broker
| typedef bsl::function<void(rmqp::MessageGuard&)> BloombergLP::rmqp::Consumer::ConsumerFunc |
Callback function used to receive messages.
The passed implementation is invoked on each message received from the broker. rmqp::MessageGuard is used to pass positive or negative acknowledgments to the broker after processing. The callback will always be invoked from the RabbitContext threadpool.
|
pure virtual |
Cancels the consumer, stops new messages flowing in.
Implemented in BloombergLP::rmqa::ConsumerImpl.
|
pure virtual |
Tells the broker to stop delivering messages to this consumer.
| timeout | How long to wait for all delivered (unacked) messages to be processed by the user provided callback. If timeout is 0, the method will wait indefinitely for them to complete, unless the client is disconnected from the broker in between. |
Implemented in BloombergLP::rmqa::ConsumerImpl.
|
pure virtual |
Can only be called (successfully) once the Consumer has been cancelled, returns a future which resolves when all outstanding acks have been sent to the server,.
Implemented in BloombergLP::rmqa::ConsumerImpl.
|
pure virtual |
Updates topology.
Implemented in BloombergLP::rmqa::ConsumerImpl.