Class for passing arguments to RabbitContext.
More...
#include <rmqa_rabbitcontextoptions.h>
|
|
typedef bsl::set< bsl::string > | Tunables |
| |
|
|
| RabbitContextOptions () |
| | By Default RabbitContext will 1) Create it's own threadpool for calling back to client code e.g. consuming messages, confirming published messages 2) Stub out error notifications - this library retries indefinitely for operations requested of it, set an error handler to be made aware of ongoing retry attempts in order to circuit break the retries for your applications needs 3) Stub out metric publishing, if you would like to publish metrics please provide an implementation that confirms to the MetricPublisher interface.
|
| |
| RabbitContextOptions & | setThreadpool (bdlmt::ThreadPool *threadpool) |
| |
| RabbitContextOptions & | setMetricPublisher (const bsl::shared_ptr< rmqp::MetricPublisher > &metricPublisher) |
| |
| RabbitContextOptions & | setErrorCallback (const rmqt::ErrorCallback &errorCallback) |
| |
| RabbitContextOptions & | setClientProperty (const bsl::string &name, const rmqt::FieldValue &value) |
| |
| RabbitContextOptions & | setMessageProcessingTimeout (const bsls::TimeInterval &timeout) |
| | Set time in which consumers should process messages. More...
|
| |
| RabbitContextOptions & | setConnectionErrorThreshold (const bsl::optional< bsls::TimeInterval > &timeout) |
| | Set time threshold at which point the error callback is called if there has been no success in establishing an amqp connection to the broker. More...
|
| |
| RabbitContextOptions & | setConsumerTracing (const bsl::shared_ptr< rmqp::ConsumerTracing > &consumerTracing) |
| | will be called back to create a context which spans for the lifetime of the messageguard before it is passed to its consumer message processor if there has More...
|
| |
| RabbitContextOptions & | setProducerTracing (const bsl::shared_ptr< rmqp::ProducerTracing > &producerTracing) |
| | will be called back at message send, with meta data to establish a context, the context will be kept alive until the messageConfirm response callback More...
|
| |
|
RabbitContextOptions & | useRabbitMQFieldValueEncoding (bool rabbitEncoding) |
| | DEPRECATED: Previously was used to switch between AMQP-spec and RabbitMQ-spec Field Value encoding. This is now always true.
|
| |
| RabbitContextOptions & | setShuffleConnectionEndpoints (bool shuffleConnectionEndpoints) |
| | Shuffle endpoints rmq connects to. By default, boost asio (libc) resolves and connects to the node with longest matching subnet prefix causing disproportionately more connections with certain endpoints. Setting this option will shuffle resolver results. More...
|
| |
|
bdlmt::ThreadPool * | threadpool () const |
| |
|
const bsl::shared_ptr< rmqp::MetricPublisher > & | metricPublisher () const |
| |
|
const rmqt::ErrorCallback & | errorCallback () const |
| |
|
const rmqt::FieldTable & | clientProperties () const |
| |
|
const bsls::TimeInterval & | messageProcessingTimeout () const |
| |
|
const bsl::optional< bsls::TimeInterval > & | connectionErrorThreshold () const |
| |
|
const rmqt::Tunables & | tunables () const |
| |
|
const bsl::shared_ptr< rmqp::ConsumerTracing > & | consumerTracing () const |
| |
|
const bsl::shared_ptr< rmqp::ProducerTracing > & | producerTracing () const |
| |
|
const bsl::optional< bool > & | shuffleConnectionEndpoints () const |
| |
Class for passing arguments to RabbitContext.
This class provides passing arguments to RabbitContext. It allows specifying the async callback threadpool, metric publisher and error callback. If any of them are not specified, a default value is used.
◆ setClientProperty()
| RabbitContextOptions & BloombergLP::rmqa::RabbitContextOptions::setClientProperty |
( |
const bsl::string & |
name, |
|
|
const rmqt::FieldValue & |
value |
|
) |
| |
- Parameters
-
| name | name of client property to set |
| value | value of client property NOTE: The following properties are set by default and can be overridden: task, pid, os, os_version, os_patch. The following properties are reserved and cannot be overridden: capabilities, platform, product, version, connection_name |
◆ setConnectionErrorThreshold()
| RabbitContextOptions & BloombergLP::rmqa::RabbitContextOptions::setConnectionErrorThreshold |
( |
const bsl::optional< bsls::TimeInterval > & |
timeout | ) |
|
Set time threshold at which point the error callback is called if there has been no success in establishing an amqp connection to the broker.
- Parameters
-
◆ setConsumerTracing()
will be called back to create a context which spans for the lifetime of the messageguard before it is passed to its consumer message processor if there has
- Parameters
-
◆ setErrorCallback()
| RabbitContextOptions & BloombergLP::rmqa::RabbitContextOptions::setErrorCallback |
( |
const rmqt::ErrorCallback & |
errorCallback | ) |
|
- Parameters
-
| errorCallback | function will be called with error detail, when channel or connection is closed by rabbitmq broker. |
◆ setMessageProcessingTimeout()
| RabbitContextOptions & BloombergLP::rmqa::RabbitContextOptions::setMessageProcessingTimeout |
( |
const bsls::TimeInterval & |
timeout | ) |
|
Set time in which consumers should process messages.
- Parameters
-
| timeout | Message processing timeout This timeout specifies the time interval in which a consumer is supposed to process a message. If a consumer takes longer that the specified timeout, warnings will be logged. |
- Note
- the library detects such cases periodically and the warnings generally won't be logged immediately after the given timeout expires. False-positive warnings may still be logged if the library has not processed the consumer acknowledgement before the timeout expires.
◆ setMetricPublisher()
- Parameters
-
| metricPublisher | custom metric publisher will be used to publish different types of metrics generated by the library. |
◆ setProducerTracing()
will be called back at message send, with meta data to establish a context, the context will be kept alive until the messageConfirm response callback
- Parameters
-
◆ setShuffleConnectionEndpoints()
| RabbitContextOptions & BloombergLP::rmqa::RabbitContextOptions::setShuffleConnectionEndpoints |
( |
bool |
shuffleConnectionEndpoints | ) |
|
Shuffle endpoints rmq connects to. By default, boost asio (libc) resolves and connects to the node with longest matching subnet prefix causing disproportionately more connections with certain endpoints. Setting this option will shuffle resolver results.
- Parameters
-
| shuffleConnectionEndpoints | set to true to shuffle. |
◆ setThreadpool()
| RabbitContextOptions & BloombergLP::rmqa::RabbitContextOptions::setThreadpool |
( |
bdlmt::ThreadPool * |
threadpool | ) |
|
- Parameters
-
| threadpool | For async callbacks (e.g. as messages arrived for Consumer, and as confirmations arrive for Producer). By default a threadpool is created with the following parameters: rmqp::Connection::s_threadPoolMinThreads rmqp::Connection::s_threadPoolMaxThreads rmqp::Connection::s_threadPoolMaxIdleTimeMs A custom threadpool can be provided if it is desirable for async callbacks to be executed in a shared threadpool, or to tune this threadpool. The provided threadpool must live longer than the RabbitContext |
The documentation for this class was generated from the following files: