Table of Contents

Class OutboxOptions

Namespace
Trellis.EntityFrameworkCore
Assembly
Trellis.EntityFrameworkCore.Outbox.dll

Tuning for the transactional outbox relay (OutboxRelay{TContext}).

public sealed class OutboxOptions
Inheritance
OutboxOptions
Inherited Members
Extension Methods

Properties

BatchSize

Maximum messages drained per poll. Default: 100. Must be greater than zero.

public int BatchSize { get; set; }

Property Value

int

LeaseDuration

How long a relay drain holds an exclusive claim (lease) on the rows it drains before another instance may reclaim them. Set it comfortably above the time to publish one batch so a slow batch is not reclaimed mid-flight; a crashed instance's rows become reclaimable once the lease expires. Default: 5 minutes. Must be greater than zero.

public TimeSpan LeaseDuration { get; set; }

Property Value

TimeSpan

MaxAttempts

Maximum relay attempts before a failing message is parked (left unprocessed but skipped by the scan so it does not block later messages). Default: 10. Must be greater than zero.

public int MaxAttempts { get; set; }

Property Value

int

MaxRetryBackoff

The ceiling on the exponential retry backoff: the per-retry wait grows from RetryBackoff but never exceeds this, so a persistently failing message keeps being retried at a steady, bounded cadence (rather than spacing out into many hours) until it reaches MaxAttempts. Default: 1 hour. Must be greater than or equal to RetryBackoff.

public TimeSpan MaxRetryBackoff { get; set; }

Property Value

TimeSpan

PollInterval

How long the relay waits before polling again when the outbox is empty. Default: 5 seconds. Must be greater than zero.

public TimeSpan PollInterval { get; set; }

Property Value

TimeSpan

RetryBackoff

The base delay before a failed message is retried. The relay backs off exponentially from this base — the wait after the nth failed attempt is RetryBackoff × 2^(n-1), capped at MaxRetryBackoff — so a transient failure is retried with growing spacing instead of in a tight loop that would hammer the database. Default: 30 seconds. Must be greater than zero.

public TimeSpan RetryBackoff { get; set; }

Property Value

TimeSpan

RetryBackoffJitter

How much of the computed exponential backoff is spread by a deterministic, per-message jitter, as a fraction in [0, 1]. The jitter only ever subtracts from the delay — the actual wait is computed × (1 - RetryBackoffJitter × f(Id)) for a stable f(Id) ∈ [0, 1) — so it never exceeds MaxRetryBackoff while de-correlating messages that failed together, so they do not all retry the instant a failed dependency recovers. 0 disables jitter (every message uses the exact computed delay). Default: 0.5. Must be between 0 and 1 inclusive.

public double RetryBackoffJitter { get; set; }

Property Value

double