Table of Contents

Interface IOutboxReader

Namespace
Silverback.Messaging.Producing.TransactionalOutbox
Assembly
Silverback.Integration.dll

Exposes the methods to read from the outbox.

public interface IOutboxReader

Remarks

Used by the IOutboxWorker.

Methods

AcknowledgeAsync(IEnumerable<OutboxMessage>)

Called after the messages have been successfully produced to remove them from the outbox.

Task AcknowledgeAsync(IEnumerable<OutboxMessage> outboxMessages)

Parameters

outboxMessages IEnumerable<OutboxMessage>

The acknowledged messages.

Returns

Task

A Task representing the result of the asynchronous operation.

GetAsync(int)

Reads the specified number of messages from the outbox (according to the FIFO rule). The operation must be acknowledged for the messages to be removed.

Task<IDisposableAsyncEnumerable<OutboxMessage>> GetAsync(int count)

Parameters

count int

The number of items to be dequeued.

Returns

Task<IDisposableAsyncEnumerable<OutboxMessage>>

A Task representing the result of the asynchronous operation. The task result contains the collection of OutboxMessage.

GetLengthAsync()

Returns the total number of messages in the outbox.

Task<int> GetLengthAsync()

Returns

Task<int>

A Task<TResult> representing the asynchronous operation. The task result contains the number of messages in the outbox.

GetMaxAgeAsync()

Gets a TimeSpan representing the time elapsed since the oldest message currently in the outbox was written.

Task<TimeSpan> GetMaxAgeAsync()

Returns

Task<TimeSpan>

The age of the oldest message.