Table of Contents

Interface IMessageWrapper

Namespace
Silverback.Messaging.Producing.Routing
Assembly
Silverback.Integration.dll

Wraps the messages in an IOutboundEnvelope<TMessage> and produces them using the specified producers.

public interface IMessageWrapper

Methods

WrapAndProduceAsync<TMessage>(TMessage?, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)

Wraps the message in an IOutboundEnvelope<TMessage> and publishes it.

Task WrapAndProduceAsync<TMessage>(TMessage? message, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class

Parameters

message TMessage

The message to be produced.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>>

An optional action that can be used to configure the envelope.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TMessage

The type of the message to be produced.

WrapAndProduceAsync<TMessage, TArgument>(TMessage?, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument, CancellationToken)

Wraps the message in an IOutboundEnvelope<TMessage> and publishes it.

Task WrapAndProduceAsync<TMessage, TArgument>(TMessage? message, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

message TMessage

The message to be produced.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the envelopeConfigurationAction.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TMessage

The type of the message to be produced.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

WrapAndProduceBatchAsync<TMessage>(IAsyncEnumerable<TMessage?>, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)

Wraps the messages in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TMessage>(IAsyncEnumerable<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class

Parameters

messages IAsyncEnumerable<TMessage>

The messages to be produced.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>>

An optional action that can be used to configure the envelopes.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TMessage

The type of the messages to be produced.

WrapAndProduceBatchAsync<TMessage>(IEnumerable<TMessage?>, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)

Wraps the messages in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TMessage>(IEnumerable<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class

Parameters

messages IEnumerable<TMessage>

The messages to be produced.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>>

An optional action that can be used to configure the envelopes.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TMessage

The type of the messages to be produced.

WrapAndProduceBatchAsync<TMessage>(IReadOnlyCollection<TMessage?>, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)

Wraps the messages in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TMessage>(IReadOnlyCollection<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class

Parameters

messages IReadOnlyCollection<TMessage>

The messages to be produced.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>>

An optional action that can be used to configure the envelopes.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TMessage

The type of the messages to be produced.

WrapAndProduceBatchAsync<TMessage, TArgument>(IAsyncEnumerable<TMessage?>, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument, CancellationToken)

Wraps the messages in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TMessage, TArgument>(IAsyncEnumerable<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

messages IAsyncEnumerable<TMessage>

The messages to be produced.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the envelopeConfigurationAction.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TMessage

The type of the messages to be produced.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

WrapAndProduceBatchAsync<TSource, TMessage>(IAsyncEnumerable<TSource>, IPublisher, IReadOnlyCollection<IProducer>, Func<TSource, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource>?, CancellationToken)

Maps the source objects into messages, wraps them in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TSource, TMessage>(IAsyncEnumerable<TSource> sources, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class

Parameters

sources IAsyncEnumerable<TSource>

The source objects to be mapped.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

mapperFunction Func<TSource, TMessage>

The function used to map the source objects to messages.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TSource>

An optional action that can be used to configure the envelopes.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

WrapAndProduceBatchAsync<TMessage, TArgument>(IEnumerable<TMessage?>, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument, CancellationToken)

Wraps the messages in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TMessage, TArgument>(IEnumerable<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

messages IEnumerable<TMessage>

The messages to be produced.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the envelopeConfigurationAction.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TMessage

The type of the messages to be produced.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

WrapAndProduceBatchAsync<TSource, TMessage>(IEnumerable<TSource>, IPublisher, IReadOnlyCollection<IProducer>, Func<TSource, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource>?, CancellationToken)

Maps the source objects into messages, wraps them in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TSource, TMessage>(IEnumerable<TSource> sources, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class

Parameters

sources IEnumerable<TSource>

The source objects to be mapped.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

mapperFunction Func<TSource, TMessage>

The function used to map the source objects to messages.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TSource>

An optional action that can be used to configure the envelopes.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

WrapAndProduceBatchAsync<TMessage, TArgument>(IReadOnlyCollection<TMessage?>, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument, CancellationToken)

Wraps the messages in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TMessage, TArgument>(IReadOnlyCollection<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

messages IReadOnlyCollection<TMessage>

The messages to be produced.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the envelopeConfigurationAction.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TMessage

The type of the messages to be produced.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

WrapAndProduceBatchAsync<TSource, TMessage>(IReadOnlyCollection<TSource>, IPublisher, IReadOnlyCollection<IProducer>, Func<TSource, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource>?, CancellationToken)

Maps the source objects into messages, wraps them in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TSource, TMessage>(IReadOnlyCollection<TSource> sources, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class

Parameters

sources IReadOnlyCollection<TSource>

The source objects to be mapped.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

mapperFunction Func<TSource, TMessage>

The function used to map the source objects to messages.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TSource>

An optional action that can be used to configure the envelopes.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

WrapAndProduceBatchAsync<TSource, TMessage, TArgument>(IAsyncEnumerable<TSource>, IPublisher, IReadOnlyCollection<IProducer>, Func<TSource, TArgument, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource, TArgument>, TArgument, CancellationToken)

Maps the source objects into messages, wraps them in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TSource, TMessage, TArgument>(IAsyncEnumerable<TSource> sources, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

sources IAsyncEnumerable<TSource>

The source objects to be mapped.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

mapperFunction Func<TSource, TArgument, TMessage>

The function used to map the source objects to messages.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TSource, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the mapperFunction and the envelopeConfigurationAction.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

WrapAndProduceBatchAsync<TSource, TMessage, TArgument>(IEnumerable<TSource>, IPublisher, IReadOnlyCollection<IProducer>, Func<TSource, TArgument, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource, TArgument>, TArgument, CancellationToken)

Maps the source objects into messages, wraps them in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TSource, TMessage, TArgument>(IEnumerable<TSource> sources, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

sources IEnumerable<TSource>

The source objects to be mapped.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

mapperFunction Func<TSource, TArgument, TMessage>

The function used to map the source objects to messages.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TSource, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the mapperFunction and the envelopeConfigurationAction.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

WrapAndProduceBatchAsync<TSource, TMessage, TArgument>(IReadOnlyCollection<TSource>, IPublisher, IReadOnlyCollection<IProducer>, Func<TSource, TArgument, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource, TArgument>, TArgument, CancellationToken)

Maps the source objects into messages, wraps them in an IOutboundEnvelope<TMessage> and publishes them.

Task WrapAndProduceBatchAsync<TSource, TMessage, TArgument>(IReadOnlyCollection<TSource> sources, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

sources IReadOnlyCollection<TSource>

The source objects to be mapped.

publisher IPublisher

The IPublisher.

producers IReadOnlyCollection<IProducer>

The producers to be used to produce the message.

mapperFunction Func<TSource, TArgument, TMessage>

The function used to map the source objects to messages.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TSource, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the mapperFunction and the envelopeConfigurationAction.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

Task

A Task representing the asynchronous operation.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

TArgument

The type of the argument passed to the envelopeConfigurationAction.