Table of Contents

Class TransportRoutingBuilderExtensions

Namespace
Excalibur.Dispatch.Routing.Builder
Assembly
Excalibur.Dispatch.dll

Extension methods for bulk transport routing configuration.

public static class TransportRoutingBuilderExtensions
Inheritance
TransportRoutingBuilderExtensions
Inherited Members

Methods

RouteAll(ITransportRoutingBuilder, string, params Type[])

Routes all specified message types to the given transport.

[RequiresUnreferencedCode("RouteAll uses reflection to invoke the generic Route<T>() method.")]
[RequiresDynamicCode("RouteAll uses MakeGenericMethod to invoke Route<T>() at runtime.")]
public static ITransportRoutingBuilder RouteAll(this ITransportRoutingBuilder builder, string transportName, params Type[] messageTypes)

Parameters

builder ITransportRoutingBuilder

The transport routing builder.

transportName string

The target transport name (e.g., "rabbitmq", "kafka").

messageTypes Type[]

The message types to route. Each must implement IIntegrationEvent; types that do not will cause an ArgumentException.

Returns

ITransportRoutingBuilder

The builder for chaining.

Examples

routing.Transport.RouteAll("rabbitmq",
    typeof(OrderCreatedEvent),
    typeof(PaymentProcessedEvent),
    typeof(ShipmentDispatchedEvent));

Remarks

This method uses reflection to call Route<TEvent>() for each type. Generic method instances are cached for performance.

Exceptions

ArgumentNullException

Thrown when builder, transportName, or messageTypes is null.

ArgumentException

Thrown when transportName is empty/whitespace, or any element of messageTypes is null or does not implement IIntegrationEvent.