Table of Contents

Class DispatchBuilderOptionsExtensions

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

Extension methods for configuring Dispatch options in a fluent manner.

public static class DispatchBuilderOptionsExtensions
Inheritance
DispatchBuilderOptionsExtensions
Inherited Members

Methods

WithConsumer(IDispatchBuilder, Action<ConsumerOptions>)

Configures consumer-specific options.

public static IDispatchBuilder WithConsumer(this IDispatchBuilder builder, Action<ConsumerOptions> configure)

Parameters

builder IDispatchBuilder

The dispatch builder.

configure Action<ConsumerOptions>

Configuration action for consumer options.

Returns

IDispatchBuilder

The builder for fluent configuration.

WithInbox(IDispatchBuilder, Action<InboxConfigurationOptions>)

Configures inbox-specific options.

public static IDispatchBuilder WithInbox(this IDispatchBuilder builder, Action<InboxConfigurationOptions> configure)

Parameters

builder IDispatchBuilder

The dispatch builder.

configure Action<InboxConfigurationOptions>

Configuration action for inbox options.

Returns

IDispatchBuilder

The builder for fluent configuration.

WithInboxMode(IDispatchBuilder, Action<InboxConfigurationOptions>?)

Selects the store-backed inbox in place of in-memory deduplication.

public static IDispatchBuilder WithInboxMode(this IDispatchBuilder builder, Action<InboxConfigurationOptions>? configure = null)

Parameters

builder IDispatchBuilder

The dispatch builder.

configure Action<InboxConfigurationOptions>

Optional additional inbox configuration.

Returns

IDispatchBuilder

The builder for fluent configuration.

Remarks

The inbox store is a persistence concern owned by a separate package and is not registered here. Register one alongside this call; start-up fails with an actionable message if none is present, rather than running with deduplication silently absent.

WithLightMode(IDispatchBuilder, Action<ConsumerOptions>?)

Enables light mode with in-memory deduplication only.

public static IDispatchBuilder WithLightMode(this IDispatchBuilder builder, Action<ConsumerOptions>? configure = null)

Parameters

builder IDispatchBuilder

The dispatch builder.

configure Action<ConsumerOptions>

Optional additional consumer configuration.

Returns

IDispatchBuilder

The builder for fluent configuration.

WithOptions(IDispatchBuilder, Action<DispatchOptions>)

Configures Dispatch options using a fluent syntax.

public static IDispatchBuilder WithOptions(this IDispatchBuilder builder, Action<DispatchOptions> configure)

Parameters

builder IDispatchBuilder

The dispatch builder.

configure Action<DispatchOptions>

Configuration action for dispatch options.

Returns

IDispatchBuilder

The builder for fluent configuration.

Examples

builder.WithOptions(o => {
o.Inbox.Enabled = true;                    // false = light mode
o.Consumer.Dedupe.Enabled = !o.Inbox.Enabled;
o.Consumer.AckAfterHandle = true;
o.Outbox.Enabled = true;
});

WithOutbox(IDispatchBuilder, Action<OutboxConfigurationOptions>)

Configures outbox-specific options.

public static IDispatchBuilder WithOutbox(this IDispatchBuilder builder, Action<OutboxConfigurationOptions> configure)

Parameters

builder IDispatchBuilder

The dispatch builder.

configure Action<OutboxConfigurationOptions>

Configuration action for outbox options.

Returns

IDispatchBuilder

The builder for fluent configuration.

WithPerformanceOptimizations(IDispatchBuilder, bool)

Configures options for high-performance scenarios.

public static IDispatchBuilder WithPerformanceOptimizations(this IDispatchBuilder builder, bool enableInbox = false)

Parameters

builder IDispatchBuilder

The dispatch builder.

enableInbox bool

Whether to enable full inbox mode for durability.

Returns

IDispatchBuilder

The builder for fluent configuration.