Table of Contents

Interface IRabbitMQBindingBuilder

Namespace
Excalibur.Dispatch.Transport.RabbitMQ
Assembly
Excalibur.Dispatch.Transport.RabbitMQ.dll

Fluent builder interface for configuring a RabbitMQ binding between an exchange and a queue.

public interface IRabbitMQBindingBuilder
Extension Methods

Examples

rmq.ConfigureBinding(binding =>
{
    binding.Exchange("events")
           .Queue("order-handlers")
           .RoutingKey("orders.*");
});

Remarks

Access this builder through ConfigureBinding(Action<IRabbitMQBindingBuilder>).

Bindings determine how messages are routed from exchanges to queues based on routing keys and exchange type semantics.

Methods

Arguments(IDictionary<string, object>)

Sets additional arguments for the binding.

IRabbitMQBindingBuilder Arguments(IDictionary<string, object> arguments)

Parameters

arguments IDictionary<string, object>

The arguments dictionary.

Returns

IRabbitMQBindingBuilder

The builder for chaining.

Remarks

For headers exchanges, use arguments to specify header matching criteria (e.g., "x-match": "all" or "x-match": "any").

Exceptions

ArgumentNullException

Thrown when arguments is null.

Exchange(string)

Sets the source exchange name for the binding.

IRabbitMQBindingBuilder Exchange(string exchange)

Parameters

exchange string

The exchange name.

Returns

IRabbitMQBindingBuilder

The builder for chaining.

Exceptions

ArgumentException

Thrown when exchange is null or whitespace.

Queue(string)

Sets the destination queue name for the binding.

IRabbitMQBindingBuilder Queue(string queue)

Parameters

queue string

The queue name.

Returns

IRabbitMQBindingBuilder

The builder for chaining.

Exceptions

ArgumentException

Thrown when queue is null or whitespace.

RoutingKey(string)

Sets the routing key pattern for the binding.

IRabbitMQBindingBuilder RoutingKey(string routingKey)

Parameters

routingKey string

The routing key pattern.

Returns

IRabbitMQBindingBuilder

The builder for chaining.

Remarks

Routing key semantics depend on the exchange type:

  • Direct: Exact match required
  • Topic: Supports wildcards (* matches one word, # matches zero or more)
  • Fanout: Routing key is ignored
  • Headers: Routing key is ignored; headers are used instead

Exceptions

ArgumentNullException

Thrown when routingKey is null.

WithArgument(string, object)

Adds a single argument for the binding.

IRabbitMQBindingBuilder WithArgument(string key, object value)

Parameters

key string

The argument key.

value object

The argument value.

Returns

IRabbitMQBindingBuilder

The builder for chaining.

Exceptions

ArgumentException

Thrown when key is null or whitespace.