Class RouteMetadataAttribute
Attribute that provides routing metadata for message classes, specifying how messages should be routed through the messaging infrastructure. This attribute controls message delivery behavior, targeting specific buses, queues, topics, and routing patterns.
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public sealed class RouteMetadataAttribute : Attribute
- Inheritance
-
RouteMetadataAttribute
- Inherited Members
- Extension Methods
Constructors
RouteMetadataAttribute(string?, bool, string?, string?, string?, string?)
Attribute that provides routing metadata for message classes, specifying how messages should be routed through the messaging infrastructure. This attribute controls message delivery behavior, targeting specific buses, queues, topics, and routing patterns.
public RouteMetadataAttribute(string? busName, bool forceRemote = false, string? routingKey = null, string? activityName = null, string? queueName = null, string? topicName = null)
Parameters
busNamestringThe name of the message bus to use for routing this message type. If null, uses the default bus.
forceRemoteboolWhether to force remote delivery even if a local handler is available. Defaults to false.
routingKeystringThe routing key to use for message routing in exchanges and topic-based systems. If null, uses message type name.
activityNamestringThe name of the activity for tracing and monitoring purposes. If null, uses the message type name.
queueNamestringThe specific queue name to route messages to. If null, uses default queue naming conventions.
topicNamestringThe specific topic name to publish messages to. If null, uses default topic naming conventions.
Properties
ActivityName
Gets the activity name for tracing and monitoring purposes. This name is used in distributed tracing systems to track message flow and performance metrics.
public string? ActivityName { get; init; }
Property Value
- string
The activity name string, or null to use the message type name as the activity name.
BusName
Gets the name of the message bus to use for routing this message type. When null, the default bus configuration will be used for message routing.
public string? BusName { get; init; }
Property Value
- string
The bus name string, or null to use the default bus.
ForceRemote
Gets a value indicating whether to force remote delivery even if a local handler is available. When true, messages will always be sent to the remote messaging infrastructure, bypassing any local in-process handlers.
public bool ForceRemote { get; init; }
Property Value
- bool
True to force remote delivery; false to allow local processing when possible.
QueueName
Gets the specific queue name to route messages to. When specified, messages will be sent directly to this queue instead of using default queue naming conventions or routing logic.
public string? QueueName { get; init; }
Property Value
- string
The queue name string, or null to use default queue naming.
RoutingKey
Gets the routing key to use for message routing in exchanges and topic-based messaging systems. This key determines which queues or consumers receive the message in routing scenarios.
public string? RoutingKey { get; init; }
Property Value
- string
The routing key string, or null to use default routing based on message type.
TopicName
Gets the specific topic name to publish messages to. When specified, messages will be published to this topic instead of using default topic naming conventions or routing logic.
public string? TopicName { get; init; }
Property Value
- string
The topic name string, or null to use default topic naming.