Table of Contents

Class OutboxOptions

Namespace
Ratatoskr.EfCore
Assembly
Ratatoskr.EfCore.dll

Configuration options for the outbox pattern.

public class OutboxOptions
Inheritance
OutboxOptions
Inherited Members

Properties

BatchSize

Number of messages to process in each batch. Default: 100.

CleanupBatchSize

Maximum number of rows to delete per cleanup batch to avoid long-running transactions. Only applies when RetentionPeriod is set. Default: 10000.

CleanupInterval

How often the cleanup service runs to delete old processed messages. Only applies when RetentionPeriod is set. Default: 1 hour.

CleanupLockName

Name of the distributed lock used by the cleanup service. Only one instance acquires the lock per cleanup cycle; others skip the cycle. Default: "OutboxCleanup_{DbContextTypeName}" (auto-generated per DbContext to avoid collisions).

LockAcquireTimeout

Maximum time to wait when acquiring the distributed lock. Default: 60 seconds.

LockName

Name of the distributed lock. Default: "OutboxProcessor_{DbContextTypeName}" (auto-generated per DbContext to avoid collisions).

MaxMessageSize

Maximum allowed size of the serialized message body in bytes. Messages exceeding this limit will cause SaveChangesAsync to throw an InvalidOperationException, rolling back the entire transaction. Default: null (no limit).

MaxRetries

Maximum number of retry attempts before marking a message as poisoned. Default: 5.

MaxRetryDelay

Maximum backoff delay between retries. Default: 5 minutes.

PollingInterval

How often to poll the database for unsent messages. Default: 60 seconds.

RestartDelay

How long to wait before restarting after a crash. Default: 5 seconds.

RetentionPeriod

How long to keep successfully processed messages before automatic cleanup deletes them. Poisoned messages are never auto-deleted — they require manual investigation. Default: null (automatic cleanup disabled).

SendTimeout

Maximum time a send operation is allowed to run before being cancelled. When set, the send receives a cancellation token that fires after this duration. Timeout cancellation is treated as a failure (increments ErrorCount) and will eventually lead to poisoning after MaxRetries. Default: null (no timeout).

StuckMessageThreshold

How long a message can be in "processing" state before it's considered stuck. Default: 5 minutes.