Interface ITransportAdapterRouter
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
cancellationTokenCancellationTokenToken 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
adapterIMessageBusAdapterThe transport adapter to register.
adapterIdstringThe unique identifier for the adapter.
cancellationTokenCancellationTokenToken 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
messageIDispatchMessageThe message received from the transport.
contextIMessageContextThe message context containing transport metadata.
adapterIdstringThe identifier of the transport adapter that received the message.
cancellationTokenCancellationTokenToken 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
messagesIReadOnlyList<IDispatchMessage>The batch of messages received from the transport.
contextsIReadOnlyList<IMessageContext>The message contexts for each message in the batch.
adapterIdstringThe identifier of the transport adapter that received the messages.
cancellationTokenCancellationTokenToken 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
adapterIdstringThe identifier of the adapter to unregister.
cancellationTokenCancellationTokenToken to cancel the unregistration operation.
Returns
- Task
A task representing the unregistration operation.