Table of Contents

Interface ITransportRegistry

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

Registry for managing transport adapters and their configurations.

public interface ITransportRegistry
Extension Methods

Remarks

Transport packages use this interface to register their adapters during DI composition. Runtime code uses it to look up adapters by name.

The default implementation is registered as a singleton via GetOrCreateTransportRegistry(IServiceCollection).

Properties

DefaultTransportName

Gets the name of the default transport.

string? DefaultTransportName { get; }

Property Value

string

The default transport name, or null if not set.

HasDefaultTransport

Gets a value indicating whether a default transport has been configured.

bool HasDefaultTransport { get; }

Property Value

bool

true if a default transport is set; otherwise, false.

HasRemoteTransport

Gets a value indicating whether any registered transport — initialized or a pending factory — delivers across a network boundary (Remote).

bool HasRemoteTransport { get; }

Property Value

bool

true if at least one registered transport is remote; otherwise false.

Methods

GetTransportAdapter(string)

Gets a transport adapter by name.

ITransportAdapter? GetTransportAdapter(string name)

Parameters

name string

The transport name.

Returns

ITransportAdapter

The transport adapter, or null if not found.

GetTransportNames()

Gets all registered transport names, including pending factories.

IEnumerable<string> GetTransportNames()

Returns

IEnumerable<string>

Collection of transport names (both initialized and pending).

RegisterTransport(string, ITransportAdapter, string, TransportLocality, Dictionary<string, object>?)

Registers a transport adapter.

void RegisterTransport(string name, ITransportAdapter adapter, string transportType, TransportLocality locality, Dictionary<string, object>? options = null)

Parameters

name string

The transport name.

adapter ITransportAdapter

The transport adapter.

transportType string

The transport type identifier.

locality TransportLocality

Whether the transport delivers in-process (Local) or across a network boundary (Remote).

options Dictionary<string, object>

Optional transport options.

RegisterTransportFactory(string, string, TransportLocality, Func<IServiceProvider, ITransportAdapter>)

Registers a transport adapter factory for deferred creation.

void RegisterTransportFactory(string name, string transportType, TransportLocality locality, Func<IServiceProvider, ITransportAdapter> factory)

Parameters

name string

The transport name.

transportType string

The transport type identifier.

locality TransportLocality

Whether the transport delivers in-process (Local) or across a network boundary (Remote).

factory Func<IServiceProvider, ITransportAdapter>

Factory function to create the adapter at runtime.

SetDefaultTransport(string)

Sets the default transport by name.

void SetDefaultTransport(string name)

Parameters

name string

The name of the transport to set as default.

Exceptions

InvalidOperationException

Thrown when the specified transport is not registered.