Interface IOutboxBulkCleanup
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
olderThanDateTimeOffsetRemove messages sent before this timestamp.
batchSizeintMaximum number of messages to delete per batch iteration.
cancellationTokenCancellationTokenToken to monitor for cancellation requests.
Returns
Exceptions
- ArgumentOutOfRangeException
Thrown when
batchSizeis less than 1.