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
builderIDispatchBuilderThe dispatch builder.
configureAction<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
builderIDispatchBuilderThe dispatch builder.
configureAction<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
builderIDispatchBuilderThe dispatch builder.
configureAction<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
builderIDispatchBuilderThe dispatch builder.
configureAction<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
builderIDispatchBuilderThe dispatch builder.
configureAction<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
builderIDispatchBuilderThe dispatch builder.
configureAction<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
builderIDispatchBuilderThe dispatch builder.
enableInboxboolWhether to enable full inbox mode for durability.
Returns
- IDispatchBuilder
The builder for fluent configuration.