Table of Contents

Class SqliteOutboxReader

Namespace
Silverback.Messaging.Producing.TransactionalOutbox
Assembly
Silverback.Storage.Sqlite.dll

Reads from the SQLite outbox.

public class SqliteOutboxReader : IOutboxReader
Inheritance
SqliteOutboxReader
Implements
Inherited Members

Constructors

SqliteOutboxReader(SqliteOutboxSettings)

Initializes a new instance of the SqliteOutboxReader class.

public SqliteOutboxReader(SqliteOutboxSettings settings)

Parameters

settings SqliteOutboxSettings

The outbox settings.

Methods

AcknowledgeAsync(IEnumerable<OutboxMessage>)

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

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

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

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

public Task<TimeSpan> GetMaxAgeAsync()

Returns

Task<TimeSpan>

The age of the oldest message.