Show / Hide Table of Contents

    Class EntityFrameworkOutboxReader

    Reads from the EntityFramework outbox.

    Inheritance
    object
    EntityFrameworkOutboxReader
    Implements
    IOutboxReader
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Silverback.Messaging.Producing.TransactionalOutbox
    Assembly: Silverback.Storage.EntityFramework.dll
    Syntax
    public class EntityFrameworkOutboxReader : IOutboxReader

    Constructors

    EntityFrameworkOutboxReader(EntityFrameworkOutboxSettings, IServiceScopeFactory)

    Initializes a new instance of the EntityFrameworkOutboxReader class.

    Declaration
    public EntityFrameworkOutboxReader(EntityFrameworkOutboxSettings settings, IServiceScopeFactory serviceScopeFactory)
    Parameters
    Type Name Description
    EntityFrameworkOutboxSettings settings

    The outbox settings.

    IServiceScopeFactory serviceScopeFactory

    The IServiceScopeFactory.

    Methods

    AcknowledgeAsync(IEnumerable<OutboxMessage>)

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

    Declaration
    public Task AcknowledgeAsync(IEnumerable<OutboxMessage> outboxMessages)
    Parameters
    Type Name Description
    IEnumerable<OutboxMessage> outboxMessages

    The acknowledged messages.

    Returns
    Type Description
    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.

    Declaration
    public Task<IDisposableAsyncEnumerable<OutboxMessage>> GetAsync(int count)
    Parameters
    Type Name Description
    int count

    The number of items to be dequeued.

    Returns
    Type Description
    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.

    Declaration
    public Task<int> GetLengthAsync()
    Returns
    Type Description
    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.

    Declaration
    public Task<TimeSpan> GetMaxAgeAsync()
    Returns
    Type Description
    Task<TimeSpan>

    The age of the oldest message.

    Implements

    IOutboxReader
    GitHub E-Mail
    ↑ Back to top © 2026 Sergio Aquilini