Interface IFallbackRoutingBuilder
Fluent builder for configuring fallback routing behavior.
public interface IFallbackRoutingBuilder
- Extension Methods
Examples
routing.Fallback
.To("dead-letter-queue")
.WithReason("No matching routing rules");
Remarks
Fallback routes are used when no other routing rules match a message. This provides a safety net to ensure messages are not lost and can be routed to dead-letter queues or default handlers.
Properties
Endpoint
Gets the configured fallback endpoint.
string? Endpoint { get; }
Property Value
Reason
Gets the configured fallback reason.
string? Reason { get; }
Property Value
Methods
To(string)
Specifies the fallback endpoint for unrouted messages.
IFallbackRoutingBuilder To(string endpoint)
Parameters
endpointstringThe fallback endpoint name.
Returns
- IFallbackRoutingBuilder
The builder for chaining.
Exceptions
- ArgumentException
Thrown when
endpointis null or whitespace.
WithReason(string)
Specifies a reason to include in routing diagnostics when fallback is used.
IFallbackRoutingBuilder WithReason(string reason)
Parameters
reasonstringThe diagnostic reason.
Returns
- IFallbackRoutingBuilder
The builder for chaining.
Exceptions
- ArgumentException
Thrown when
reasonis null or whitespace.