Table of Contents

Interface IOutboxBulkCleanup

Namespace
Excalibur.Dispatch
Assembly
Excalibur.Dispatch.Abstractions.dll

Provides bulk cleanup operations for outbox stores (ISP sub-interface of IOutboxStoreAdmin).

public interface IOutboxBulkCleanup
Extension Methods

Remarks

This interface separates bulk cleanup concerns from the core IOutboxStoreAdmin interface, following the Interface Segregation Principle. Implementations can perform efficient batch deletions with configurable batch sizes to avoid locking the database for extended periods.

Access via DI: services.GetService<IOutboxBulkCleanup>()

Methods

BulkCleanupAllTenantsSentMessagesAsync(DateTimeOffset, int, CancellationToken)

Deletes sent messages in batches, processing up to batchSize per iteration.

ValueTask<int> BulkCleanupAllTenantsSentMessagesAsync(DateTimeOffset olderThan, int batchSize, CancellationToken cancellationToken)

Parameters

olderThan DateTimeOffset

Remove messages sent before this timestamp.

batchSize int

Maximum number of messages to delete per batch iteration.

cancellationToken CancellationToken

Token to monitor for cancellation requests.

Returns

ValueTask<int>

The total number of messages deleted across all batches.

Exceptions

ArgumentOutOfRangeException

Thrown when batchSize is less than 1.