Table of Contents

Class IntegrationPublisherExtensions

Namespace
Silverback.Messaging.Publishing
Assembly
Silverback.Integration.dll

Adds the WrapAndPublish,WrapAndPublishBatch, WrapAndPublishAsync, and WrapAndPublishBatchAsync methods to the IPublisher interface.

public static class IntegrationPublisherExtensions
Inheritance
IntegrationPublisherExtensions
Inherited Members

Remarks

The exceptions documented on IProducer (e.g. ProduceException and MessageValidationException) propagate as well.

Methods

WrapAndPublishAsync<TMessage>(IPublisher, TMessage?, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)

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

public static Task WrapAndPublishAsync<TMessage>(this IPublisher publisher, TMessage? message, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

message TMessage

The message to be published.

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 published.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishAsync<TMessage>(IPublisher, TMessage?, CancellationToken)

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

public static Task WrapAndPublishAsync<TMessage>(this IPublisher publisher, TMessage? message, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

message TMessage

The message to be published.

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 published.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishAsync<TMessage, TArgument>(IPublisher, TMessage?, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument, CancellationToken)

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

public static Task WrapAndPublishAsync<TMessage, TArgument>(this IPublisher publisher, TMessage? message, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

message TMessage

The message to be published.

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 published.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatchAsync<TMessage>(IPublisher, IAsyncEnumerable<TMessage?>, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TMessage>(this IPublisher publisher, IAsyncEnumerable<TMessage?> messages, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IAsyncEnumerable<TMessage>

The messages to be published.

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 published.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TMessage>(IPublisher, IAsyncEnumerable<TMessage?>, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TMessage>(this IPublisher publisher, IAsyncEnumerable<TMessage?> messages, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IAsyncEnumerable<TMessage>

The messages to be published.

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 published.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TMessage>(IPublisher, IEnumerable<TMessage?>, Action<IOutboundEnvelope<TMessage>>?, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TMessage>(this IPublisher publisher, IEnumerable<TMessage?> messages, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IEnumerable<TMessage>

The messages to be published.

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 published.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TMessage>(IPublisher, IEnumerable<TMessage?>, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TMessage>(this IPublisher publisher, IEnumerable<TMessage?> messages, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IEnumerable<TMessage>

The messages to be published.

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 published.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

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

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

public static Task WrapAndPublishBatchAsync<TMessage>(this IPublisher publisher, IReadOnlyCollection<TMessage?> messages, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IReadOnlyCollection<TMessage>

The messages to be published.

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 published.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatchAsync<TMessage>(IPublisher, IReadOnlyCollection<TMessage?>, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TMessage>(this IPublisher publisher, IReadOnlyCollection<TMessage?> messages, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IReadOnlyCollection<TMessage>

The messages to be published.

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 published.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatchAsync<TMessage, TArgument>(IPublisher, IAsyncEnumerable<TMessage?>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TMessage, TArgument>(this IPublisher publisher, IAsyncEnumerable<TMessage?> messages, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IAsyncEnumerable<TMessage>

The messages to be published.

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 published.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TSource, TMessage>(IPublisher, IAsyncEnumerable<TSource>, Func<TSource, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource>?, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TSource, TMessage>(this IPublisher publisher, IAsyncEnumerable<TSource> sources, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IAsyncEnumerable<TSource>

The source objects to be mapped.

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.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TSource, TMessage>(IPublisher, IAsyncEnumerable<TSource>, Func<TSource, TMessage?>, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TSource, TMessage>(this IPublisher publisher, IAsyncEnumerable<TSource> sources, Func<TSource, TMessage?> mapperFunction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IAsyncEnumerable<TSource>

The source objects to be mapped.

mapperFunction Func<TSource, TMessage>

The function used to map the source objects to messages.

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.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TMessage, TArgument>(IPublisher, IEnumerable<TMessage?>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TMessage, TArgument>(this IPublisher publisher, IEnumerable<TMessage?> messages, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IEnumerable<TMessage>

The messages to be published.

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 published.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TSource, TMessage>(IPublisher, IEnumerable<TSource>, Func<TSource, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource>?, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TSource, TMessage>(this IPublisher publisher, IEnumerable<TSource> sources, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IEnumerable<TSource>

The source objects to be mapped.

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.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TSource, TMessage>(IPublisher, IEnumerable<TSource>, Func<TSource, TMessage?>, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TSource, TMessage>(this IPublisher publisher, IEnumerable<TSource> sources, Func<TSource, TMessage?> mapperFunction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IEnumerable<TSource>

The source objects to be mapped.

mapperFunction Func<TSource, TMessage>

The function used to map the source objects to messages.

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.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

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

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

public static Task WrapAndPublishBatchAsync<TMessage, TArgument>(this IPublisher publisher, IReadOnlyCollection<TMessage?> messages, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IReadOnlyCollection<TMessage>

The messages to be published.

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 published.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

Exceptions

RoutingException

No producer is configured for the message type.

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

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

public static Task WrapAndPublishBatchAsync<TSource, TMessage>(this IPublisher publisher, IReadOnlyCollection<TSource> sources, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IReadOnlyCollection<TSource>

The source objects to be mapped.

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.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatchAsync<TSource, TMessage>(IPublisher, IReadOnlyCollection<TSource>, Func<TSource, TMessage?>, CancellationToken)

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

public static Task WrapAndPublishBatchAsync<TSource, TMessage>(this IPublisher publisher, IReadOnlyCollection<TSource> sources, Func<TSource, TMessage?> mapperFunction, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IReadOnlyCollection<TSource>

The source objects to be mapped.

mapperFunction Func<TSource, TMessage>

The function used to map the source objects to messages.

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.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatchAsync<TSource, TMessage, TArgument>(IPublisher, IAsyncEnumerable<TSource>, 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.

public static Task WrapAndPublishBatchAsync<TSource, TMessage, TArgument>(this IPublisher publisher, IAsyncEnumerable<TSource> sources, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IAsyncEnumerable<TSource>

The source objects to be mapped.

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.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TSource, TMessage, TArgument>(IPublisher, IEnumerable<TSource>, 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.

public static Task WrapAndPublishBatchAsync<TSource, TMessage, TArgument>(this IPublisher publisher, IEnumerable<TSource> sources, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IEnumerable<TSource>

The source objects to be mapped.

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.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatchAsync<TSource, TMessage, TArgument>(IPublisher, IReadOnlyCollection<TSource>, 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.

public static Task WrapAndPublishBatchAsync<TSource, TMessage, TArgument>(this IPublisher publisher, IReadOnlyCollection<TSource> sources, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument, CancellationToken cancellationToken = default) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IReadOnlyCollection<TSource>

The source objects to be mapped.

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.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatch<TMessage>(IPublisher, IAsyncEnumerable<TMessage?>, Action<IOutboundEnvelope<TMessage>>?)

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

public static void WrapAndPublishBatch<TMessage>(this IPublisher publisher, IAsyncEnumerable<TMessage?> messages, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IAsyncEnumerable<TMessage>

The messages to be published.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>>

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

Type Parameters

TMessage

The type of the messages to be published.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatch<TMessage>(IPublisher, IEnumerable<TMessage?>, Action<IOutboundEnvelope<TMessage>>?)

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

public static void WrapAndPublishBatch<TMessage>(this IPublisher publisher, IEnumerable<TMessage?> messages, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IEnumerable<TMessage>

The messages to be published.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>>

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

Type Parameters

TMessage

The type of the messages to be published.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatch<TMessage>(IPublisher, IReadOnlyCollection<TMessage?>, Action<IOutboundEnvelope<TMessage>>?)

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

public static void WrapAndPublishBatch<TMessage>(this IPublisher publisher, IReadOnlyCollection<TMessage?> messages, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IReadOnlyCollection<TMessage>

The messages to be published.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>>

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

Type Parameters

TMessage

The type of the messages to be published.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatch<TMessage, TArgument>(IPublisher, IAsyncEnumerable<TMessage?>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument)

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

public static void WrapAndPublishBatch<TMessage, TArgument>(this IPublisher publisher, IAsyncEnumerable<TMessage?> messages, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IAsyncEnumerable<TMessage>

The messages to be published.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the envelopeConfigurationAction.

Type Parameters

TMessage

The type of the messages to be published.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatch<TSource, TMessage>(IPublisher, IAsyncEnumerable<TSource>, Func<TSource, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource>?)

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

public static void WrapAndPublishBatch<TSource, TMessage>(this IPublisher publisher, IAsyncEnumerable<TSource> sources, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction = null) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IAsyncEnumerable<TSource>

The source objects to be mapped.

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.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatch<TMessage, TArgument>(IPublisher, IEnumerable<TMessage?>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument)

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

public static void WrapAndPublishBatch<TMessage, TArgument>(this IPublisher publisher, IEnumerable<TMessage?> messages, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IEnumerable<TMessage>

The messages to be published.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the envelopeConfigurationAction.

Type Parameters

TMessage

The type of the messages to be published.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatch<TSource, TMessage>(IPublisher, IEnumerable<TSource>, Func<TSource, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource>?)

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

public static void WrapAndPublishBatch<TSource, TMessage>(this IPublisher publisher, IEnumerable<TSource> sources, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction = null) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IEnumerable<TSource>

The source objects to be mapped.

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.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatch<TMessage, TArgument>(IPublisher, IReadOnlyCollection<TMessage?>, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument)

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

public static void WrapAndPublishBatch<TMessage, TArgument>(this IPublisher publisher, IReadOnlyCollection<TMessage?> messages, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

messages IReadOnlyCollection<TMessage>

The messages to be published.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the envelopeConfigurationAction.

Type Parameters

TMessage

The type of the messages to be published.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatch<TSource, TMessage>(IPublisher, IReadOnlyCollection<TSource>, Func<TSource, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource>?)

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

public static void WrapAndPublishBatch<TSource, TMessage>(this IPublisher publisher, IReadOnlyCollection<TSource> sources, Func<TSource, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource>? envelopeConfigurationAction = null) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IReadOnlyCollection<TSource>

The source objects to be mapped.

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.

Type Parameters

TSource

The type of the source objects.

TMessage

The type of the messages to be produced.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublishBatch<TSource, TMessage, TArgument>(IPublisher, IAsyncEnumerable<TSource>, Func<TSource, TArgument, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource, TArgument>, TArgument)

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

public static void WrapAndPublishBatch<TSource, TMessage, TArgument>(this IPublisher publisher, IAsyncEnumerable<TSource> sources, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IAsyncEnumerable<TSource>

The source objects to be mapped.

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.

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.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatch<TSource, TMessage, TArgument>(IPublisher, IEnumerable<TSource>, Func<TSource, TArgument, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource, TArgument>, TArgument)

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

public static void WrapAndPublishBatch<TSource, TMessage, TArgument>(this IPublisher publisher, IEnumerable<TSource> sources, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IEnumerable<TSource>

The source objects to be mapped.

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.

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.

Exceptions

RoutingException

No producer is configured for the message type, or more than one producer is configured for it (not supported for enumerable batches).

WrapAndPublishBatch<TSource, TMessage, TArgument>(IPublisher, IReadOnlyCollection<TSource>, Func<TSource, TArgument, TMessage?>, Action<IOutboundEnvelope<TMessage>, TSource, TArgument>, TArgument)

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

public static void WrapAndPublishBatch<TSource, TMessage, TArgument>(this IPublisher publisher, IReadOnlyCollection<TSource> sources, Func<TSource, TArgument, TMessage?> mapperFunction, Action<IOutboundEnvelope<TMessage>, TSource, TArgument> envelopeConfigurationAction, TArgument argument) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

sources IReadOnlyCollection<TSource>

The source objects to be mapped.

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.

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.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublish<TMessage>(IPublisher, TMessage?, Action<IOutboundEnvelope<TMessage>>?)

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

public static void WrapAndPublish<TMessage>(this IPublisher publisher, TMessage? message, Action<IOutboundEnvelope<TMessage>>? envelopeConfigurationAction = null) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

message TMessage

The message to be published.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>>

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

Type Parameters

TMessage

The type of the message to be published.

Exceptions

RoutingException

No producer is configured for the message type.

WrapAndPublish<TMessage, TArgument>(IPublisher, TMessage?, Action<IOutboundEnvelope<TMessage>, TArgument>, TArgument)

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

public static void WrapAndPublish<TMessage, TArgument>(this IPublisher publisher, TMessage? message, Action<IOutboundEnvelope<TMessage>, TArgument> envelopeConfigurationAction, TArgument argument) where TMessage : class

Parameters

publisher IPublisher

The IPublisher.

message TMessage

The message to be published.

envelopeConfigurationAction Action<IOutboundEnvelope<TMessage>, TArgument>

The action used to configure the envelopes.

argument TArgument

The argument to be passed to the envelopeConfigurationAction.

Type Parameters

TMessage

The type of the message to be published.

TArgument

The type of the argument passed to the envelopeConfigurationAction.

Exceptions

RoutingException

No producer is configured for the message type.