Mocks rmqp::Consumer and/or rmqa::Consumer.
More...
#include <rmqtestmocks_mockconsumer.h>
◆ 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.
◆ cancel()
| virtual rmqt::Future BloombergLP::rmqp::Consumer::cancel |
( |
| ) |
|
|
pure virtualinherited |
Cancels the consumer, stops new messages flowing in.
- Returns
- A Future which, when resolved, confirms that the server won't send any more messages.
Implemented in BloombergLP::rmqa::ConsumerImpl.
◆ cancelAndDrain()
| virtual rmqt::Result BloombergLP::rmqp::Consumer::cancelAndDrain |
( |
const bsls::TimeInterval & |
timeout | ) |
|
|
pure virtualinherited |
Tells the broker to stop delivering messages to this consumer.
- Parameters
-
| 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. |
- Returns
- a result once all of the remaining messages have been n/acked by the consuming code, or error otherwise e.g. timeout
- Deprecated:
- Note
- this relies on the consumer code processing all of the outstanding messages.
Implemented in BloombergLP::rmqa::ConsumerImpl.
◆ drain()
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,.
- Note
- : this relies on the consumer code processing all of the outstanding messages received.
Implemented in BloombergLP::rmqa::ConsumerImpl.
◆ updateTopologyAsync()
The documentation for this class was generated from the following files: