Table of Contents

Interface IDeduplicationStore

Namespace
Excalibur.Dispatch.Delivery
Assembly
Excalibur.Outbox.dll

Defines a store for message deduplication tracking.

public interface IDeduplicationStore

Methods

AddAsync(string, TimeSpan?, CancellationToken)

Marks a message as processed.

Task AddAsync(string messageId, TimeSpan? expiry, CancellationToken cancellationToken)

Parameters

messageId string

The unique identifier of the message.

expiry TimeSpan?

Optional expiry time for the deduplication entry.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the asynchronous operation.

CheckAndMarkAsync(string, DeduplicationContext, CancellationToken)

Checks if a message has been processed and marks it as processed if not.

Task<DeduplicationResult> CheckAndMarkAsync(string messageId, DeduplicationContext context, CancellationToken cancellationToken)

Parameters

messageId string

The unique identifier of the message.

context DeduplicationContext

The deduplication context.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<DeduplicationResult>

A result indicating whether the message is a duplicate.

ClearExpiredAsync(CancellationToken)

Clears expired entries from the store.

Task<int> ClearExpiredAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of entries removed.

ContainsAsync(string, CancellationToken)

Checks if a message has been processed.

Task<bool> ContainsAsync(string messageId, CancellationToken cancellationToken)

Parameters

messageId string

The unique identifier of the message.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>

True if the message has been processed; otherwise, false.

RemoveAsync(string, CancellationToken)

Removes a message from the deduplication store.

Task<bool> RemoveAsync(string messageId, CancellationToken cancellationToken)

Parameters

messageId string

The unique identifier of the message.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>

True if the message was removed; otherwise, false.