Class CreateChannelOptions
Channel creation options.
public sealed class CreateChannelOptions
- Inheritance
-
CreateChannelOptions
- Inherited Members
Constructors
CreateChannelOptions(bool, bool, RateLimiter?, ushort?)
public CreateChannelOptions(bool publisherConfirmationsEnabled, bool publisherConfirmationTrackingEnabled, RateLimiter? outstandingPublisherConfirmationsRateLimiter = null, ushort? consumerDispatchConcurrency = 1)
Parameters
publisherConfirmationsEnabled
boolpublisherConfirmationTrackingEnabled
booloutstandingPublisherConfirmationsRateLimiter
RateLimiterconsumerDispatchConcurrency
ushort?
Fields
ConsumerDispatchConcurrency
Set to a value greater than one to enable concurrent processing. For a concurrency greater than one IAsyncBasicConsumer will be offloaded to the worker thread pool so it is important to choose the value for the concurrency wisely to avoid thread pool overloading. IAsyncBasicConsumer can handle concurrency much more efficiently due to the non-blocking nature of the consumer.
Defaults to null
, which will use the value from ConsumerDispatchConcurrency
For concurrency greater than one this removes the guarantee that consumers handle messages in the order they receive them. In addition to that consumers need to be thread/concurrency safe.
public readonly ushort? ConsumerDispatchConcurrency
Field Value
OutstandingPublisherConfirmationsRateLimiter
If the publisher confirmation tracking is enabled, this represents the rate limiter used to throttle additional attempts to publish once the threshold is reached.
Defaults to a ThrottlingRateLimiter with a limit of 128 and a throttling percentage of 50% with a delay during throttling.
public readonly RateLimiter? OutstandingPublisherConfirmationsRateLimiter
Field Value
Remarks
Setting the rate limiter to null
disables the rate limiting entirely.
PublisherConfirmationTrackingEnabled
Should this library track publisher confirmations for you? Defaults to false
When enabled, the PublishSequenceNumberHeader header will be
added to every published message, and will contain the message's publish sequence number.
If the broker then sends a basic.return
response for the message, this library can
then correctly handle the message.
public readonly bool PublisherConfirmationTrackingEnabled
Field Value
PublisherConfirmationsEnabled
Enable or disable publisher confirmations on this channel. Defaults to false
Note that, if this is enabled, and PublisherConfirmationTrackingEnabled is not
enabled, the broker may send a basic.return
response if a message is published with mandatory: true
and the broker can't route the message. This response will not, however, contain the publish sequence number
for the message, so it is difficult to correlate the response to the correct message. Users of this library
could add the PublishSequenceNumberHeader header with the value returned by
GetNextPublishSequenceNumberAsync(CancellationToken) to allow correlation
of the response with the correct message.
public readonly bool PublisherConfirmationsEnabled