Table of Contents

Interface IRabbitMQConnectionBuilder

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

Builder interface for configuring RabbitMQ connection settings.

public interface IRabbitMQConnectionBuilder
Extension Methods

Remarks

Provides methods for setting the host, port, virtual host, credentials, and connection string for RabbitMQ transport connections.

Methods

AutomaticRecovery(bool, TimeSpan?)

Configures automatic connection recovery behavior.

IRabbitMQTransportBuilder AutomaticRecovery(bool enabled, TimeSpan? networkRecoveryInterval = null)

Parameters

enabled bool

Whether automatic connection recovery is enabled.

networkRecoveryInterval TimeSpan?

The interval between network recovery attempts. When null, the existing configured value is retained (default 10 seconds).

Returns

IRabbitMQTransportBuilder

The builder for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when networkRecoveryInterval is negative or zero.

ConnectionString(string)

Sets the AMQP connection string (alternative to individual connection properties).

IRabbitMQTransportBuilder ConnectionString(string connectionString)

Parameters

connectionString string

The AMQP connection string (e.g., "amqp://user:pass@host:port/vhost").

Returns

IRabbitMQTransportBuilder

The builder for chaining.

Remarks

When a connection string is provided, it takes precedence over individual HostName(string), Port(int), VirtualHost(string), and Credentials(string, string) settings.

Exceptions

ArgumentException

Thrown when connectionString is null or whitespace.

Credentials(string, string)

Sets the credentials for authentication.

IRabbitMQTransportBuilder Credentials(string username, string password)

Parameters

username string

The username.

password string

The password.

Returns

IRabbitMQTransportBuilder

The builder for chaining.

Exceptions

ArgumentException

Thrown when username is null or whitespace.

HostName(string)

Sets the RabbitMQ host name.

IRabbitMQTransportBuilder HostName(string hostName)

Parameters

hostName string

The host name or IP address.

Returns

IRabbitMQTransportBuilder

The builder for chaining.

Exceptions

ArgumentException

Thrown when hostName is null or whitespace.

Port(int)

Sets the RabbitMQ port.

IRabbitMQTransportBuilder Port(int port)

Parameters

port int

The port number (typically 5672 for AMQP, 5671 for AMQPS).

Returns

IRabbitMQTransportBuilder

The builder for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when port is not between 1 and 65535.

VirtualHost(string)

Sets the virtual host.

IRabbitMQTransportBuilder VirtualHost(string vhost)

Parameters

vhost string

The virtual host path.

Returns

IRabbitMQTransportBuilder

The builder for chaining.

Exceptions

ArgumentException

Thrown when vhost is null or whitespace.