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
messageTMessageThe message to be produced.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>>An optional action that can be used to configure the envelope.
cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TMessageThe 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
messageTMessageThe message to be produced.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TArgument>The action used to configure the envelopes.
argumentTArgumentThe argument to be passed to the
envelopeConfigurationAction.cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TMessageThe type of the message to be produced.
TArgumentThe 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
messagesIAsyncEnumerable<TMessage>The messages to be produced.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>>An optional action that can be used to configure the envelopes.
cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TMessageThe 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
messagesIEnumerable<TMessage>The messages to be produced.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>>An optional action that can be used to configure the envelopes.
cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TMessageThe 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
messagesIReadOnlyCollection<TMessage>The messages to be produced.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>>An optional action that can be used to configure the envelopes.
cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TMessageThe 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
messagesIAsyncEnumerable<TMessage>The messages to be produced.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TArgument>The action used to configure the envelopes.
argumentTArgumentThe argument to be passed to the
envelopeConfigurationAction.cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TMessageThe type of the messages to be produced.
TArgumentThe 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
sourcesIAsyncEnumerable<TSource>The source objects to be mapped.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
mapperFunctionFunc<TSource, TMessage>The function used to map the source objects to messages.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TSource>An optional action that can be used to configure the envelopes.
cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TSourceThe type of the source objects.
TMessageThe 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
messagesIEnumerable<TMessage>The messages to be produced.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TArgument>The action used to configure the envelopes.
argumentTArgumentThe argument to be passed to the
envelopeConfigurationAction.cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TMessageThe type of the messages to be produced.
TArgumentThe 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
sourcesIEnumerable<TSource>The source objects to be mapped.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
mapperFunctionFunc<TSource, TMessage>The function used to map the source objects to messages.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TSource>An optional action that can be used to configure the envelopes.
cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TSourceThe type of the source objects.
TMessageThe 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
messagesIReadOnlyCollection<TMessage>The messages to be produced.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TArgument>The action used to configure the envelopes.
argumentTArgumentThe argument to be passed to the
envelopeConfigurationAction.cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TMessageThe type of the messages to be produced.
TArgumentThe 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
sourcesIReadOnlyCollection<TSource>The source objects to be mapped.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
mapperFunctionFunc<TSource, TMessage>The function used to map the source objects to messages.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TSource>An optional action that can be used to configure the envelopes.
cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TSourceThe type of the source objects.
TMessageThe 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
sourcesIAsyncEnumerable<TSource>The source objects to be mapped.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
mapperFunctionFunc<TSource, TArgument, TMessage>The function used to map the source objects to messages.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TSource, TArgument>The action used to configure the envelopes.
argumentTArgumentThe argument to be passed to the
mapperFunctionand theenvelopeConfigurationAction.cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TSourceThe type of the source objects.
TMessageThe type of the messages to be produced.
TArgumentThe 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
sourcesIEnumerable<TSource>The source objects to be mapped.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
mapperFunctionFunc<TSource, TArgument, TMessage>The function used to map the source objects to messages.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TSource, TArgument>The action used to configure the envelopes.
argumentTArgumentThe argument to be passed to the
mapperFunctionand theenvelopeConfigurationAction.cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TSourceThe type of the source objects.
TMessageThe type of the messages to be produced.
TArgumentThe 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
sourcesIReadOnlyCollection<TSource>The source objects to be mapped.
publisherIPublisherThe IPublisher.
producersIReadOnlyCollection<IProducer>The producers to be used to produce the message.
mapperFunctionFunc<TSource, TArgument, TMessage>The function used to map the source objects to messages.
envelopeConfigurationActionAction<IOutboundEnvelope<TMessage>, TSource, TArgument>The action used to configure the envelopes.
argumentTArgumentThe argument to be passed to the
mapperFunctionand theenvelopeConfigurationAction.cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TSourceThe type of the source objects.
TMessageThe type of the messages to be produced.
TArgumentThe type of the argument passed to the
envelopeConfigurationAction.