Enum OutboxStagingStrategy
Controls how integration events are staged to the outbox during aggregate save operations.
public enum OutboxStagingStrategy
- Extension Methods
Fields
Auto = 0The framework selects the best available strategy automatically. Uses Transactional when ITransactionalOutboxWriter and a transactional event store are available, falls back to EventuallyConsistent when only IOutboxStore is available, and Deferred when neither is registered.
Deferred = 3Does not stage integration events during the save operation. Events are processed later by a background service (e.g., event store polling). Zero added latency to save operations. Suitable for high-throughput scenarios where minimal save latency is more important than immediate message delivery.
EventuallyConsistent = 2Stages integration events to the outbox in a separate operation after the event append succeeds. Minimal latency impact with a tiny window for message loss if the process crashes between event append and outbox staging. Requires IOutboxStore.
Transactional = 1Stages integration events within the same database transaction as the event append. Guarantees zero message loss but adds latency to the save operation. Requires ITransactionalOutboxWriter and a transactional event store. Falls back to EventuallyConsistent if transactional infrastructure is unavailable.
Remarks
This setting controls the trade-off between delivery guarantees and save latency. Choose the strategy that matches your consistency and performance requirements.
- Auto -- Framework selects the best strategy based on available infrastructure (default)
- Transactional -- Atomic with event append, zero message loss, adds save latency
- EventuallyConsistent -- Staged after save in a separate call, tiny loss window
- Deferred -- No staging during save; background service processes events later, zero added latency