Class DynamicEndpointResolver
Per-instance cache that resolves an endpoint URI per exchange (via a
${...} template, an , or a factory delegate),
then looks up the matching component, creates a producer for the resolved URI,
starts it, caches it by resolved URI string, and reuses it on subsequent calls.
Used by dynamic-endpoint processors (, dynamic
WireTap/Enrich/PollEnrich/RecipientList) so producers are not recreated on every
message. Producers are also registered with so they
participate in the standard graceful-shutdown flow.
public sealed class DynamicEndpointResolver
Inheritance
Methods
FromExpression(IRouteContext, IExpression)
Creates a resolver that evaluates an per exchange.
public static DynamicEndpointResolver FromExpression(IRouteContext context, IExpression expression)
FromTemplate(IRouteContext, string)
Creates a resolver that resolves a ${...} template per exchange.
public static DynamicEndpointResolver FromTemplate(IRouteContext context, string template)
GetOrCreateProducerAsync(string, CancellationToken)
Returns the started producer for an already-resolved URI, creating and caching it on first use.
public Task<IProducer> GetOrCreateProducerAsync(string resolvedUri, CancellationToken ct)
ResolveProducerAsync(IExchange, CancellationToken)
Resolves the URI for exchange and returns a (cached) started producer.
public Task<IProducer> ResolveProducerAsync(IExchange exchange, CancellationToken ct)
ResolveUri(IExchange)
Resolves the target URI for this exchange without creating a producer (used by InterceptSendToEndpoint).
public string ResolveUri(IExchange exchange)
Constructors
DynamicEndpointResolver(IRouteContext, Func<IExchange, string>)
Creates a resolver that calls uriFactory per exchange.