Class OutboxWorker
Inheritance
Implements
Inherited Members
Namespace: Silverback.Messaging.Outbound.TransactionalOutbox
Assembly: Silverback.Integration.dll
Syntax
public class OutboxWorker : IOutboxWorker
Constructors
| Improve this doc View sourceOutboxWorker(IServiceScopeFactory, IBrokerCollection, IOutboundRoutingConfiguration, IOutboundLogger<OutboxWorker>, Boolean, Int32)
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 |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceScopeFactory | serviceScopeFactory | The Microsoft.Extensions.DependencyInjection.IServiceScopeFactory used to resolve the scoped types. |
IBrokerCollection | brokerCollection | The collection containing the available brokers. |
IOutboundRoutingConfiguration | routingConfiguration | The configured outbound routes. |
IOutboundLogger<OutboxWorker> | logger | |
System.Boolean | enforceMessageOrder | Specifies whether the messages must be produced in the same order as they were added to the queue.
If set to |
System.Int32 | batchSize | The number of messages to be loaded and processed at once. |
Methods
| Improve this doc View sourceProcessQueueAsync(CancellationToken)
Declaration
public async Task ProcessQueueAsync(CancellationToken stoppingToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | stoppingToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
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 |
---|---|---|
System.Byte[] | content | The serialized message content (body). |
System.Collections.Generic.IReadOnlyCollection<MessageHeader> | headers | The collection of message headers. |
IProducerEndpoint | endpoint | The endpoint to produce to. |
System.String | actualEndpointName | The actual endpoint name that was resolved for the message. |
System.Action<IBrokerMessageIdentifier> | onSuccess | The callback to be invoked when the message is successfully produced. |
System.Action<System.Exception> | onError | The callback to be invoked when the produce fails. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing the asynchronous operation. |