Interface IRabbitMQTransportBuilder
Fluent builder interface for configuring RabbitMQ transport options.
public interface IRabbitMQTransportBuilder : IRabbitMQConnectionBuilder, IRabbitMQTopologyBuilder, IRabbitMQRoutingBuilder
- Inherited Members
- Extension Methods
Examples
services.AddRabbitMQTransport("events", rmq =>
{
rmq.HostName("localhost")
.Port(5672)
.VirtualHost("/")
.Credentials("guest", "guest")
.ConfigureExchange(exchange =>
{
exchange.Name("events")
.Type(RabbitMQExchangeType.Topic)
.Durable(true);
})
.ConfigureQueue(queue =>
{
queue.Name("order-handlers")
.Durable(true)
.PrefetchCount(10);
})
.ConfigureBinding(binding =>
{
binding.Exchange("events")
.Queue("order-handlers")
.RoutingKey("orders.*");
})
.MapExchange<OrderCreated>("events");
});
Remarks
This interface follows the Microsoft-style fluent builder pattern with single entry point and fluent chaining for configuring RabbitMQ transport connections, exchanges, queues, bindings, and dead letters.
The builder is composed of focused sub-interfaces following the Interface Segregation Principle:
- IRabbitMQConnectionBuilder -- connection settings (host, port, credentials).
- IRabbitMQTopologyBuilder -- topology configuration (exchanges, queues, bindings).
- IRabbitMQRoutingBuilder -- message routing and SSL.
Access this builder through AddRabbitMQTransport(IServiceCollection, string, Action<IRabbitMQTransportBuilder>).