Class InboxPipelineExtensions
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- Excalibur.Dispatch.dll
Extension methods for adding inbox (idempotency) middleware to the dispatch pipeline.
public static class InboxPipelineExtensions
- Inheritance
-
InboxPipelineExtensions
- Inherited Members
Methods
UseIdempotency(IDispatchBuilder)
Adds idempotency middleware to the dispatch pipeline. This is an alias for UseInbox(IDispatchBuilder) -- both register the same InboxMiddleware which provides message deduplication.
public static IDispatchBuilder UseIdempotency(this IDispatchBuilder builder)
Parameters
builderIDispatchBuilderThe dispatch builder.
Returns
- IDispatchBuilder
The builder for fluent configuration.
UseInbox(IDispatchBuilder)
Adds inbox middleware to the dispatch pipeline.
public static IDispatchBuilder UseInbox(this IDispatchBuilder builder)
Parameters
builderIDispatchBuilderThe dispatch builder.
Returns
- IDispatchBuilder
The builder for fluent configuration.
Remarks
The inbox middleware tracks processed messages to ensure idempotent handling. Duplicate messages are detected and short-circuited before reaching the handler.
Inbox services (including an IInboxStore implementation) must be registered
separately in the DI container. This method only adds the middleware to the pipeline.
Recommended pipeline order:
builder.UseAuthentication()
.UseAuthorization()
.UseInbox() // Deduplicate before validation/processing
.UseValidation()
.UseTransaction();