Show / Hide Table of Contents

    Class OutboxWorker

    Processes the outbox and produces the messages to the target message broker endpoint.

    Inheritance
    object
    OutboxWorker
    Implements
    IOutboxWorker
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Outbound.TransactionalOutbox
    Assembly: Silverback.Integration.dll
    Syntax
    public class OutboxWorker : IOutboxWorker

    Constructors

    | Improve this doc View source

    OutboxWorker(IServiceScopeFactory, IBrokerCollection, IOutboundRoutingConfiguration, IOutboundLogger<OutboxWorker>, bool, int)

    Initializes a new instance of the OutboxWorker class.

    Declaration
    public OutboxWorker(IServiceScopeFactory serviceScopeFactory, IBrokerCollection brokerCollection, IOutboundRoutingConfiguration routingConfiguration, IOutboundLogger<OutboxWorker> logger, bool enforceMessageOrder, int batchSize)
    Parameters
    Type Name Description
    IServiceScopeFactory serviceScopeFactory

    The IServiceScopeFactory used to resolve the scoped types.

    IBrokerCollection brokerCollection

    The collection containing the available brokers.

    IOutboundRoutingConfiguration routingConfiguration

    The configured outbound routes.

    IOutboundLogger<OutboxWorker> logger

    The IOutboundLogger<TCategoryName>.

    bool enforceMessageOrder

    Specifies whether the messages must be produced in the same order as they were added to the queue. If set to true the message order will be ensured, retrying the same message until it can be successfully produced.

    int batchSize

    The number of messages to be loaded and processed at once.

    Methods

    | Improve this doc View source

    ProcessQueueAsync(CancellationToken)

    Processes the outbox.

    Declaration
    public Task ProcessQueueAsync(CancellationToken stoppingToken)
    Parameters
    Type Name Description
    CancellationToken stoppingToken

    A CancellationToken to observe while waiting for the task to complete.

    Returns
    Type Description
    Task

    A Task that represents the long running operations.

    | Improve this doc View source

    ProduceMessageAsync(byte[]?, IReadOnlyCollection<MessageHeader>?, IProducerEndpoint, string, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Gets the producer for the specified endpoint and produces the specified message.

    Declaration
    protected virtual Task ProduceMessageAsync(byte[]? content, IReadOnlyCollection<MessageHeader>? headers, IProducerEndpoint endpoint, string actualEndpointName, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    byte[] content

    The serialized message content (body).

    IReadOnlyCollection<MessageHeader> headers

    The collection of message headers.

    IProducerEndpoint endpoint

    The endpoint to produce to.

    string actualEndpointName

    The actual endpoint name that was resolved for the message.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Implements

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