Interface IMessageWrapper
Wraps the messages in an IOutboundEnvelope<TMessage> and produces them using the specified producers.
Namespace: Silverback.Messaging.Producing.Routing
Assembly: Silverback.Integration.dll
Syntax
public interface IMessageWrapper
Methods
WrapAndProduceAsync<TMessage>(TMessage?, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)
Wraps the message in an IOutboundEnvelope<TMessage> and publishes it.
Declaration
Task WrapAndProduceAsync<TMessage>(TMessage? message, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to be produced. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Action<IOutboundEnvelope<TMessage>> | envelopeConfigurationAction | An optional action that can be used to configure the envelope. |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to be produced. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Action<IOutboundEnvelope<TMessage>, TArgument> | envelopeConfigurationAction | The action used to configure the envelopes. |
| TArgument | argument | The argument to be passed to the |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the message to be produced. |
| TArgument | The type of the argument passed to the |
WrapAndProduceBatchAsync<TMessage>(IAsyncEnumerable<TMessage?>, IPublisher, IReadOnlyCollection<IProducer>, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)
Wraps the messages in an IOutboundEnvelope<TMessage> and publishes them.
Declaration
Task WrapAndProduceBatchAsync<TMessage>(IAsyncEnumerable<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TMessage> | messages | The messages to be produced. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Action<IOutboundEnvelope<TMessage>> | envelopeConfigurationAction | An optional action that can be used to configure the envelopes. |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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.
Declaration
Task WrapAndProduceBatchAsync<TMessage>(IEnumerable<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<TMessage> | messages | The messages to be produced. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Action<IOutboundEnvelope<TMessage>> | envelopeConfigurationAction | An optional action that can be used to configure the envelopes. |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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.
Declaration
Task WrapAndProduceBatchAsync<TMessage>(IReadOnlyCollection<TMessage?> messages, IPublisher publisher, IReadOnlyCollection<IProducer> producers, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null, CancellationToken cancellationToken = default) where TMessage : class
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<TMessage> | messages | The messages to be produced. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Action<IOutboundEnvelope<TMessage>> | envelopeConfigurationAction | An optional action that can be used to configure the envelopes. |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TMessage> | messages | The messages to be produced. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Action<IOutboundEnvelope<TMessage>, TArgument> | envelopeConfigurationAction | The action used to configure the envelopes. |
| TArgument | argument | The argument to be passed to the |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the messages to be produced. |
| TArgument | The type of the argument passed to the |
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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TSource> | sources | The source objects to be mapped. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Func<TSource, TMessage> | mapperFunction | The function used to map the source objects to messages. |
| Action<IOutboundEnvelope<TMessage>, TSource> | envelopeConfigurationAction | An optional action that can be used to configure the envelopes. |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IEnumerable<TMessage> | messages | The messages to be produced. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Action<IOutboundEnvelope<TMessage>, TArgument> | envelopeConfigurationAction | The action used to configure the envelopes. |
| TArgument | argument | The argument to be passed to the |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the messages to be produced. |
| TArgument | The type of the argument passed to the |
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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IEnumerable<TSource> | sources | The source objects to be mapped. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Func<TSource, TMessage> | mapperFunction | The function used to map the source objects to messages. |
| Action<IOutboundEnvelope<TMessage>, TSource> | envelopeConfigurationAction | An optional action that can be used to configure the envelopes. |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<TMessage> | messages | The messages to be produced. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Action<IOutboundEnvelope<TMessage>, TArgument> | envelopeConfigurationAction | The action used to configure the envelopes. |
| TArgument | argument | The argument to be passed to the |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the messages to be produced. |
| TArgument | The type of the argument passed to the |
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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<TSource> | sources | The source objects to be mapped. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Func<TSource, TMessage> | mapperFunction | The function used to map the source objects to messages. |
| Action<IOutboundEnvelope<TMessage>, TSource> | envelopeConfigurationAction | An optional action that can be used to configure the envelopes. |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TSource> | sources | The source objects to be mapped. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Func<TSource, TArgument, TMessage> | mapperFunction | The function used to map the source objects to messages. |
| Action<IOutboundEnvelope<TMessage>, TSource, TArgument> | envelopeConfigurationAction | The action used to configure the envelopes. |
| TArgument | argument | The argument to be passed to the |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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 |
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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IEnumerable<TSource> | sources | The source objects to be mapped. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Func<TSource, TArgument, TMessage> | mapperFunction | The function used to map the source objects to messages. |
| Action<IOutboundEnvelope<TMessage>, TSource, TArgument> | envelopeConfigurationAction | The action used to configure the envelopes. |
| TArgument | argument | The argument to be passed to the |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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 |
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.
Declaration
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
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<TSource> | sources | The source objects to be mapped. |
| IPublisher | publisher | The IPublisher. |
| IReadOnlyCollection<IProducer> | producers | The producers to be used to produce the message. |
| Func<TSource, TArgument, TMessage> | mapperFunction | The function used to map the source objects to messages. |
| Action<IOutboundEnvelope<TMessage>, TSource, TArgument> | envelopeConfigurationAction | The action used to configure the envelopes. |
| TArgument | argument | The argument to be passed to the |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| 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 |