Table of Contents

Class PostgreSqlOutboxReader

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

Reads from the PostgreSql outbox.

public class PostgreSqlOutboxReader : IOutboxReader
Inheritance
PostgreSqlOutboxReader
Implements
Inherited Members

Constructors

PostgreSqlOutboxReader(PostgreSqlOutboxSettings)

Initializes a new instance of the PostgreSqlOutboxReader class.

public PostgreSqlOutboxReader(PostgreSqlOutboxSettings settings)

Parameters

settings PostgreSqlOutboxSettings

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.