Class for passing arguments to Consumer.
More...
#include <rmqt_consumerconfig.h>
|
|
static bsl::string | generateConsumerTag () |
| | Util method to generate a default Consumer tag.
|
| |
|
|
static const uint16_t | s_defaultPrefetchCount = 5 |
| |
Class for passing arguments to Consumer.
This class provides passing arguments to Consumer.
◆ ConsumerConfig()
| BloombergLP::rmqt::ConsumerConfig::ConsumerConfig |
( |
const bsl::string & |
consumerTag = generateConsumerTag(), |
|
|
uint16_t |
prefetchCount = s_defaultPrefetchCount, |
|
|
bdlmt::ThreadPool * |
threadpool = 0, |
|
|
rmqt::Exclusive::Value |
exclusiveFlag = rmqt::Exclusive::OFF, |
|
|
bsl::optional< int64_t > |
consumerPriority = bsl::optional<int64_t>() |
|
) |
| |
|
explicit |
- Parameters
-
| consumerTag | A label for the consumer which is displayed on the RabbitMQ Management UI. It is useful to give this a meaningful name. |
| prefetchCount | Used by the RabbitMQ broker to limit the number of messages held by a consumer at one time. Higher values can increase throughput, particularly in high latency environments. |
| threadpool | threadpool which should be used to process consumer (message) callbacks, defaults to using the context level threadpool |
| exclusiveFlag | Indicate to RabbitMQ that this consumer should be the only consumer from the specified queue. This may cause the consumer to remain in a declaration loop if another consumer exists on this queue. |
| consumerPriority | Indicate to RabbitMQ the priority of the consumer (between 0 and 10, higher is more important) the broker will send to available consumers in terms of priority provided the consumer is available and not blocked (per prefetchCount) see https://www.rabbitmq.com/consumer-priority.html#definitions for more details |
◆ addTransformer()
- Parameters
-
| transform | A message transformer to be undone for each message received by the consumer. Multiple transformers will be called in the inverse order, i.e. the last transformer in added is applied first. |
◆ setConsumerPriority()
| ConsumerConfig & BloombergLP::rmqt::ConsumerConfig::setConsumerPriority |
( |
const bsl::optional< int64_t > & |
consumerPriority | ) |
|
|
inline |
- Parameters
-
| consumerPriority | Indicate to RabbitMQ the priority of the consumer: larger numbers indicate higher priority, and both positive and negative numbers can be used. The broker will send to available consumers in terms of priority provided the consumer is available and not blocked (per prefetchCount) see https://www.rabbitmq.com/consumer-priority.html#definitions for more details |
◆ setConsumerTag()
| ConsumerConfig & BloombergLP::rmqt::ConsumerConfig::setConsumerTag |
( |
const bsl::string & |
consumerTag | ) |
|
|
inline |
- Parameters
-
| consumerTag | A label for the consumer which is displayed on the RabbitMQ Management UI. It is useful to give this a meaningful name. |
◆ setExclusiveFlag()
| ConsumerConfig & BloombergLP::rmqt::ConsumerConfig::setExclusiveFlag |
( |
rmqt::Exclusive::Value |
exclusiveFlag = rmqt::Exclusive::ON | ) |
|
|
inline |
- Parameters
-
| exclusiveFlag | Indicate to RabbitMQ that this consumer should be the only consumer from the specified queue. This may cause the consumer to remain in a declaration loop if another consumer exists on this queue. |
◆ setPrefetchCount()
| ConsumerConfig & BloombergLP::rmqt::ConsumerConfig::setPrefetchCount |
( |
uint16_t |
prefetchCount | ) |
|
|
inline |
- Parameters
-
| prefetchCount | Used by the RabbitMQ broker to limit the number of messages held by a consumer at one time. Higher values can increase throughput, particularly in high latency environments. |
◆ setThreadpool()
| ConsumerConfig & BloombergLP::rmqt::ConsumerConfig::setThreadpool |
( |
bdlmt::ThreadPool * |
threadpool | ) |
|
|
inline |
- Parameters
-
| threadpool | threadpool which should be used to process consumer (message) callbacks, defaults to using the context level threadpool. The passed threadpool is not owned by any rmq object and must live longer than this consumer exists on the threadpool, which will be longer than the lifetime of the Consumer object. It's recommended to keep this threadpool alive longer longer than the Context. |
The documentation for this class was generated from the following files: