Table of Contents

Class EntityFrameworkOutboxReader

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

Reads from the EntityFramework outbox.

public class EntityFrameworkOutboxReader : IOutboxReader
Inheritance
EntityFrameworkOutboxReader
Implements
Inherited Members

Constructors

EntityFrameworkOutboxReader(EntityFrameworkOutboxSettings, IServiceScopeFactory)

Initializes a new instance of the EntityFrameworkOutboxReader class.

public EntityFrameworkOutboxReader(EntityFrameworkOutboxSettings settings, IServiceScopeFactory serviceScopeFactory)

Parameters

settings EntityFrameworkOutboxSettings

The outbox settings.

serviceScopeFactory IServiceScopeFactory

The IServiceScopeFactory.

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.