Interface ITransportAdapter
Adapter interface that routes transport messages through the dispatcher pipeline rather than directly to handlers, ensuring all messages flow through IDispatcher.
public interface ITransportAdapter
- Extension Methods
Properties
IsRunning
Gets a value indicating whether the adapter is currently running.
bool IsRunning { get; }
Property Value
Name
Gets the unique name of this transport adapter.
string Name { get; }
Property Value
- string
The adapter identifier.
TransportType
Gets the transport type this adapter handles.
string TransportType { get; }
Property Value
- string
The transport type managed by the adapter.
Methods
ReceiveAsync(object, IDispatcher, CancellationToken)
Receives a message from the transport and routes it through the dispatcher.
Task<IMessageResult> ReceiveAsync(object transportMessage, IDispatcher dispatcher, CancellationToken cancellationToken)
Parameters
transportMessageobjectThe raw transport message.
dispatcherIDispatcherThe dispatcher to route through.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<IMessageResult>
The result of message processing.
SendAsync(IDispatchMessage, string, IMessageContext, CancellationToken)
Sends a message through the transport after processing.
Task SendAsync(IDispatchMessage message, string destination, IMessageContext context, CancellationToken cancellationToken)
Parameters
messageIDispatchMessageThe message to send.
destinationstringThe destination endpoint.
contextIMessageContextThe message context containing correlation, tenant, and other propagation data.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
Task representing the send operation.