Table of Contents

Interface IInboxDispatcher

Namespace
Trellis.Mediator
Assembly
Trellis.Mediator.dll

The inbound entry point for idempotent integration-event consumption. A transport adapter — a broker consumer or the in-process path — builds an IntegrationEnvelope and calls DispatchAsync(IntegrationEnvelope, CancellationToken); the dispatcher deduplicates on (ConsumerId, MessageId) so the event's integration-event handlers' side effects commit exactly once (effectively-once), together with the dedup record.

public interface IInboxDispatcher
Extension Methods

Methods

DispatchAsync(IntegrationEnvelope, CancellationToken)

Dispatches the integration event in envelope to its handlers, unless its (ConsumerId, MessageId) pair was already processed — in which case it commits nothing. The handlers' side effects and the dedup record commit atomically.

Task<InboxDispatchOutcome> DispatchAsync(IntegrationEnvelope envelope, CancellationToken cancellationToken = default)

Parameters

envelope IntegrationEnvelope

The message envelope to dispatch.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<InboxDispatchOutcome>

Processed when this call's handlers committed their side effects, or SkippedDuplicate when the message had already been processed so this call committed nothing (on the fast path no handler runs; in a lost duplicate-key race the handlers ran but rolled back). Both outcomes mean the message is durably accounted for, so a pull consumer can advance its checkpoint on either.