Interface IOutboxStore<TPayload>
- Namespace
- PatternKit.Messaging.Reliability
- Assembly
- PatternKit.Core.dll
Pluggable backing store for the Transactional Outbox pattern. Implement this interface to provide durable outbox storage (e.g., relational database, file system).
public interface IOutboxStore<TPayload>
Type Parameters
TPayloadThe outbox message payload type.
Methods
EnqueueAsync(Message<TPayload>, string?, DateTimeOffset?, CancellationToken)
Adds a message to the outbox and returns the stored record.
ValueTask<OutboxMessage<TPayload>> EnqueueAsync(Message<TPayload> message, string? id = null, DateTimeOffset? createdAt = null, CancellationToken cancellationToken = default)
Parameters
messageMessage<TPayload>idstringcreatedAtDateTimeOffset?cancellationTokenCancellationToken
Returns
- ValueTask<OutboxMessage<TPayload>>
MarkDispatchedAsync(string, DateTimeOffset, CancellationToken)
Marks a message as successfully dispatched.
ValueTask MarkDispatchedAsync(string id, DateTimeOffset dispatchedAt, CancellationToken cancellationToken = default)
Parameters
idstringdispatchedAtDateTimeOffsetcancellationTokenCancellationToken
Returns
MarkFailedAsync(string, string?, CancellationToken)
Records a failed dispatch attempt for a message.
ValueTask MarkFailedAsync(string id, string? error, CancellationToken cancellationToken = default)
Parameters
idstringerrorstringcancellationTokenCancellationToken
Returns
SnapshotPendingAsync(CancellationToken)
Returns all messages that have not yet been dispatched.
ValueTask<IReadOnlyList<OutboxMessage<TPayload>>> SnapshotPendingAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
- ValueTask<IReadOnlyList<OutboxMessage<TPayload>>>