Table of Contents

Class OutboxPipelineExtensions

Namespace
Microsoft.Extensions.DependencyInjection
Assembly
Excalibur.Dispatch.dll

Extension methods for adding outbox middleware to the dispatch pipeline.

public static class OutboxPipelineExtensions
Inheritance
OutboxPipelineExtensions
Inherited Members

Methods

UseOutbox(IDispatchBuilder)

Adds outbox middleware to the dispatch pipeline.

public static IDispatchBuilder UseOutbox(this IDispatchBuilder builder)

Parameters

builder IDispatchBuilder

The dispatch builder.

Returns

IDispatchBuilder

The builder for fluent configuration.

Remarks

The outbox middleware intercepts outgoing messages and stores them in an outbox for reliable delivery, ensuring at-least-once message publishing even if the transport is temporarily unavailable.

Outbox services (including an IOutboxStore implementation) must be registered separately in the DI container. This method adds staging middleware and a default deferred writer, preserving any writer the consumer has already registered.

Recommended pipeline order:

builder.UseAuthentication()
       .UseAuthorization()
       .UseValidation()
       .UseTransaction()
       .UseOutbox();             // Store messages for reliable delivery

UseOutbox(IDispatchBuilder, Action<OutboxStagingOptions>)

Adds outbox middleware to the dispatch pipeline with configuration.

public static IDispatchBuilder UseOutbox(this IDispatchBuilder builder, Action<OutboxStagingOptions> configure)

Parameters

builder IDispatchBuilder

The dispatch builder.

configure Action<OutboxStagingOptions>

Action to configure OutboxStagingOptions.

Returns

IDispatchBuilder

The builder for fluent configuration.