Class RouteInfo
Represents comprehensive routing information for a message destination, including endpoint details, priority, and metadata.
public sealed class RouteInfo
- Inheritance
-
RouteInfo
- Inherited Members
- Extension Methods
Remarks
RouteInfo encapsulates all information needed to make intelligent routing decisions and provides operational visibility into available message destinations. It supports priority-based routing, multi-bus architectures, and extensible metadata for custom routing logic.
Priority Semantics:
Lower priority values indicate higher precedence (evaluated first). This follows the convention used in ASP.NET Core routing.
Metadata Extensions:
The metadata dictionary enables custom routing behaviors including endpoint-specific configuration, health indicators, capacity information, and integration with external routing services or policy engines.
Constructors
RouteInfo(string, string, int)
Initializes a new instance of the RouteInfo class.
public RouteInfo(string name, string endpoint, int priority = 0)
Parameters
namestringThe human-readable name identifying this route.
endpointstringThe destination endpoint identifier.
priorityintThe routing priority (lower values = higher precedence).
Exceptions
- ArgumentException
Thrown when
nameorendpointis null or empty.
Properties
BusName
Gets or sets the message bus name for multi-bus routing scenarios.
public string? BusName { get; set; }
Property Value
- string
The identifier of the message bus instance that should handle this route. null indicates the default bus should be used.
Endpoint
Gets the destination endpoint identifier for message delivery.
public string Endpoint { get; }
Property Value
- string
The endpoint identifier that specifies where messages should be delivered (e.g., service name, queue name, topic).
Metadata
Gets the extensible metadata dictionary for custom routing behaviors.
public Dictionary<string, object?> Metadata { get; init; }
Property Value
- Dictionary<string, object>
A mutable dictionary containing key-value pairs for custom routing logic, endpoint configuration, health status, and integration data.
Remarks
Common metadata keys include:
health: Endpoint health statusregion: Geographic region for compliance or performance routingrule_type: The type of routing rule that matchedstop_on_match: Whether rule evaluation should stop on matchis_fallback: Whether this is a fallback route
Name
Gets the human-readable name that identifies this route.
public string Name { get; }
Property Value
- string
A descriptive name used for logging, monitoring, and operational visibility.
Priority
Gets the routing priority for this destination.
public int Priority { get; }
Property Value
- int
A numeric priority value where lower numbers indicate higher precedence. Routes are evaluated in ascending priority order.