Table of Contents

Class OutboxBulkCleanupAdapter

Namespace
Excalibur.Outbox
Assembly
Excalibur.Outbox.dll

Default implementation of IOutboxBulkCleanup that delegates to IOutboxStoreAdmin with iterative batch processing.

public sealed class OutboxBulkCleanupAdapter : IOutboxBulkCleanup
Inheritance
OutboxBulkCleanupAdapter
Implements
Inherited Members

Remarks

Performs bulk cleanup by repeatedly calling the admin's cleanup method in batches until no more records match the criteria. This avoids long-running database locks.

Constructors

OutboxBulkCleanupAdapter(IOutboxStoreAdmin, ILogger<OutboxBulkCleanupAdapter>)

Default implementation of IOutboxBulkCleanup that delegates to IOutboxStoreAdmin with iterative batch processing.

public OutboxBulkCleanupAdapter(IOutboxStoreAdmin admin, ILogger<OutboxBulkCleanupAdapter> logger)

Parameters

admin IOutboxStoreAdmin

The outbox store admin for cleanup operations.

logger ILogger<OutboxBulkCleanupAdapter>

The logger for diagnostic output.

Remarks

Performs bulk cleanup by repeatedly calling the admin's cleanup method in batches until no more records match the criteria. This avoids long-running database locks.

Methods

BulkCleanupAllTenantsSentMessagesAsync(DateTimeOffset, int, CancellationToken)

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

public 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.