Show / Hide Table of Contents

    Class DbOutboxReader

    Exposes the methods to read from the outbound queue. Used by the IOutboxWorker.

    An IDbContext is used to read from a queue stored in a database table.

    Inheritance
    object
    RepositoryBase<OutboxMessage>
    DbOutboxReader
    Implements
    IOutboxReader
    Inherited Members
    RepositoryBase<OutboxMessage>.DbContext
    RepositoryBase<OutboxMessage>.DbSet
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Outbound.TransactionalOutbox.Repositories
    Assembly: Silverback.Integration.dll
    Syntax
    public class DbOutboxReader : RepositoryBase<OutboxMessage>, IOutboxReader

    Constructors

    | Improve this doc View source

    DbOutboxReader(IDbContext)

    Initializes a new instance of the DbOutboxReader class.

    Declaration
    public DbOutboxReader(IDbContext dbContext)
    Parameters
    Type Name Description
    IDbContext dbContext

    The IDbContext to use as storage.

    Methods

    | Improve this doc View source

    AcknowledgeAsync(OutboxStoredMessage)

    Called after the message has been successfully produced to remove it from the outbox.

    Declaration
    public Task AcknowledgeAsync(OutboxStoredMessage outboxMessage)
    Parameters
    Type Name Description
    OutboxStoredMessage outboxMessage

    The message that was processed.

    Returns
    Type Description
    Task

    A Task representing the result of the asynchronous operation.

    | Improve this doc View source

    AcknowledgeAsync(IEnumerable<OutboxStoredMessage>)

    Called after the message has been successfully produced to remove it from the outbox.

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

    The messages that have been processed.

    Returns
    Type Description
    Task

    A Task representing the result of the asynchronous operation.

    | Improve this doc View source

    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.

    | Improve this doc View source

    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.

    | Improve this doc View source

    ReadAsync(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<IReadOnlyCollection<OutboxStoredMessage>> ReadAsync(int count)
    Parameters
    Type Name Description
    int count

    The number of items to be dequeued.

    Returns
    Type Description
    Task<IReadOnlyCollection<OutboxStoredMessage>>

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

    | Improve this doc View source

    RetryAsync(OutboxStoredMessage)

    Called when an error occurs producing the message to re-enqueue it and retry later on.

    Declaration
    public Task RetryAsync(OutboxStoredMessage outboxMessage)
    Parameters
    Type Name Description
    OutboxStoredMessage outboxMessage

    The message that was processed.

    Returns
    Type Description
    Task

    A Task representing the result of the asynchronous operation.

    | Improve this doc View source

    RetryAsync(IEnumerable<OutboxStoredMessage>)

    Called when an error occurs producing the message to re-enqueue it and retry later on.

    Declaration
    public Task RetryAsync(IEnumerable<OutboxStoredMessage> outboxMessages)
    Parameters
    Type Name Description
    IEnumerable<OutboxStoredMessage> outboxMessages

    The messages that have been processed.

    Returns
    Type Description
    Task

    A Task representing the result of the asynchronous operation.

    Implements

    IOutboxReader
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini