Class RabbitMqChannelOptions
Unified RabbitMQ configuration for a channel, covering exchange, queue, consumer, and retry settings.
Use the fluent With* methods to configure.
public class RabbitMqChannelOptions
- Inheritance
-
RabbitMqChannelOptions
- Inherited Members
Properties
- AutoAck
Whether the broker should auto-acknowledge messages on delivery. When true, messages cannot be retried on failure. Default: false.
- ExchangeAutoDelete
Whether the exchange is deleted when the last queue is unbound. Default: false.
- ExchangeDurable
Whether the exchange survives broker restarts. Default: true.
- ExchangeType
The AMQP exchange type. Default: Topic.
- PrefetchCount
Maximum number of unacknowledged messages delivered to this consumer. Lower values reduce memory usage but may decrease throughput. Default: 10.
- QueueArguments
Additional queue arguments passed to RabbitMQ on queue declaration.
- QueueAutoDelete
Whether the queue is deleted when the last consumer disconnects. Default: false. Not supported with Quorum queues.
- QueueDurable
Whether the queue survives broker restarts. Default: true.
- QueueExclusive
Whether the queue is exclusive to this connection. Default: false.
- QueueName
The name of the queue to consume from. Required for consume channels.
- Retry
Retry and dead-letter configuration for failed message processing.
Methods
- WithAutoAck(bool)
Enables or disables auto-acknowledgement of messages.
- WithDirectExchange()
Configures a direct exchange with exact routing key matching.
- WithDurableQueue()
Configures a durable queue (survives broker restarts, not exclusive, not auto-deleted). This is the default queue configuration.
- WithExchangeAutoDelete(bool)
Sets whether the exchange is deleted when the last queue is unbound.
- WithExchangeDurable(bool)
Sets whether the exchange survives broker restarts.
- WithExchangeType(RabbitMqExchangeType)
Sets the exchange type.
- WithFanoutExchange()
Configures a fanout exchange that broadcasts to all bound queues.
- WithPrefetch(ushort)
Sets the prefetch count (max unacknowledged messages per consumer).
- WithQueueArguments(IDictionary<string, object?>)
Sets additional queue arguments passed to RabbitMQ on declaration.
- WithQueueName(string)
Sets the queue name. Required for consume channels.
- WithQueueType(QueueType)
Sets the queue implementation type (Classic or Quorum).
- WithRetry(Action<RetryOptions>)
Configures retry behavior using a builder callback.
- WithRetry(int, TimeSpan?)
Configures retry behavior with max retries and optional delay.
- WithTopicExchange()
Configures a topic exchange with pattern-based routing.
- WithTransientQueue()
Configures a transient queue (non-durable, not exclusive, auto-deleted when empty). Suitable for temporary or test queues.