Table of Contents

Interface ITransportAdapterRouter

Namespace
Excalibur.Dispatch.Transport
Assembly
Excalibur.Dispatch.Abstractions.dll

Defines the interface for routing messages from transport adapters through the dispatcher.

public interface ITransportAdapterRouter
Extension Methods

Methods

CheckAdapterHealthAsync(CancellationToken)

Gets the health status of all registered transport adapters.

Task<IDictionary<string, HealthCheckResult>> CheckAdapterHealthAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Token to cancel the health check operation.

Returns

Task<IDictionary<string, HealthCheckResult>>

A task containing the health check results for all adapters.

RegisterAdapterAsync(IMessageBusAdapter, string, CancellationToken)

Registers a transport adapter with the router for message routing.

Task RegisterAdapterAsync(IMessageBusAdapter adapter, string adapterId, CancellationToken cancellationToken)

Parameters

adapter IMessageBusAdapter

The transport adapter to register.

adapterId string

The unique identifier for the adapter.

cancellationToken CancellationToken

Token to cancel the registration operation.

Returns

Task

A task representing the registration operation.

RouteAsync(IDispatchMessage, IMessageContext, string, CancellationToken)

Routes a message received from a transport adapter through the dispatcher pipeline.

Task<IMessageResult> RouteAsync(IDispatchMessage message, IMessageContext context, string adapterId, CancellationToken cancellationToken)

Parameters

message IDispatchMessage

The message received from the transport.

context IMessageContext

The message context containing transport metadata.

adapterId string

The identifier of the transport adapter that received the message.

cancellationToken CancellationToken

Token to cancel the routing operation.

Returns

Task<IMessageResult>

A task representing the routing operation result.

RouteBatchAsync(IReadOnlyList<IDispatchMessage>, IReadOnlyList<IMessageContext>, string, CancellationToken)

Routes a message batch received from a transport adapter through the dispatcher pipeline.

Task<IReadOnlyList<IMessageResult>> RouteBatchAsync(IReadOnlyList<IDispatchMessage> messages, IReadOnlyList<IMessageContext> contexts, string adapterId, CancellationToken cancellationToken)

Parameters

messages IReadOnlyList<IDispatchMessage>

The batch of messages received from the transport.

contexts IReadOnlyList<IMessageContext>

The message contexts for each message in the batch.

adapterId string

The identifier of the transport adapter that received the messages.

cancellationToken CancellationToken

Token to cancel the routing operation.

Returns

Task<IReadOnlyList<IMessageResult>>

A task representing the batch routing operation results.

UnregisterAdapterAsync(string, CancellationToken)

Unregisters a transport adapter from the router.

Task UnregisterAdapterAsync(string adapterId, CancellationToken cancellationToken)

Parameters

adapterId string

The identifier of the adapter to unregister.

cancellationToken CancellationToken

Token to cancel the unregistration operation.

Returns

Task

A task representing the unregistration operation.