Table of Contents

Interface ISqlServerOutboxBuilder

Namespace
Excalibur.Outbox.SqlServer
Assembly
Excalibur.Outbox.SqlServer.dll

Fluent builder interface for configuring SQL Server-specific outbox settings.

public interface ISqlServerOutboxBuilder
Extension Methods

Examples

outbox.UseSqlServer(sql =>
{
    sql.ConnectionString("Server=.;Database=MyDb;Trusted_Connection=True;")
       .SchemaName("Messaging")
       .TableName("OutboxMessages");
});

Remarks

Provides the canonical 4 connection overloads plus subsystem-specific configuration for outbox table names, schema, and operational settings. Follows the builder pattern established by ISqlServerCdcConnectionBuilder.

Connection overloads are mutually exclusive (last-wins): If multiple connection methods are called, the last one takes effect. Each call overwrites any previously configured connection.

Methods

BindConfiguration(string)

Binds options from an IConfiguration section.

ISqlServerOutboxBuilder BindConfiguration(string sectionPath)

Parameters

sectionPath string

The configuration section path (e.g., "Outbox:SqlServer").

Returns

ISqlServerOutboxBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when sectionPath is null or whitespace.

ConnectionFactory(Func<IServiceProvider, Func<SqlConnection>>)

Sets a factory function that creates SQL connections. Use for Azure Managed Identity, Key Vault, or custom connection pooling.

ISqlServerOutboxBuilder ConnectionFactory(Func<IServiceProvider, Func<SqlConnection>> connectionFactory)

Parameters

connectionFactory Func<IServiceProvider, Func<SqlConnection>>

A factory receiving IServiceProvider and returning a Func<SqlConnection> that creates connections on demand.

Returns

ISqlServerOutboxBuilder

The builder for fluent chaining.

Exceptions

ArgumentNullException

Thrown when connectionFactory is null.

ConnectionString(string)

Sets the SQL Server connection string.

ISqlServerOutboxBuilder ConnectionString(string connectionString)

Parameters

connectionString string

The SQL Server connection string.

Returns

ISqlServerOutboxBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when connectionString is null or whitespace.

ConnectionStringName(string)

Resolves the connection string from IConfiguration.GetConnectionString(name) at service resolution time.

ISqlServerOutboxBuilder ConnectionStringName(string name)

Parameters

name string

The connection string name in the ConnectionStrings section.

Returns

ISqlServerOutboxBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when name is null or whitespace.

EnableHealthChecks(string?)

Enables SQL Server health checks for the outbox store.

ISqlServerOutboxBuilder EnableHealthChecks(string? name = null)

Parameters

name string

Optional health check name. Default: "sqlserver-outbox".

Returns

ISqlServerOutboxBuilder

The builder for fluent chaining.

Remarks

The check queries the outbox store itself, so it distinguishes a reachable database from a usable outbox: a database that answers while the outbox table cannot serve the drain reports unhealthy. Because it issues a query, treat it as a READINESS check rather than a liveness one.

SchemaName(string)

Sets the schema name for the outbox tables. Default: "dbo".

ISqlServerOutboxBuilder SchemaName(string schema)

Parameters

schema string

The schema name (e.g., "dbo", "Messaging").

Returns

ISqlServerOutboxBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when schema is null or whitespace.

TableName(string)

Sets the table name for storing outbox messages. Default: "OutboxMessages".

ISqlServerOutboxBuilder TableName(string tableName)

Parameters

tableName string

The table name.

Returns

ISqlServerOutboxBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when tableName is null or whitespace.

TransportsTableName(string)

Sets the table name for storing transport delivery records. Default: "OutboxMessageTransports".

ISqlServerOutboxBuilder TransportsTableName(string tableName)

Parameters

tableName string

The table name for transport records.

Returns

ISqlServerOutboxBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when tableName is null or whitespace.