Class InterceptDefinition
An interception scope: its steps run before the intercepted point, optionally only when a
condition holds. Declared on a route (From(...).Intercept()...EndIntercept()) or on the
RouteBuilder for every route it defines. Intercepts are not steps of the route — they are
decorators applied when the route is compiled, so they reach steps nested in Choice,
Split, Multicast, TryCatch and every other scope.
For the target URI is available to the intercept steps
in the exchange property CamelToEndpoint (), as in Apache Camel;
makes the interception replace the send (dry runs, test doubles). A Stop() inside the
intercept stops the exchange as anywhere else.
public sealed class InterceptDefinition : RouteDefinitionBase<InterceptDefinition>, IRouteDefinition, IProcessorDefinition, IRouteScope
Inheritance
Implements
Inherited Members
Properties
Condition
Optional condition; when it does not hold the intercepted point runs untouched.
public IPredicate? Condition { get; }
UriPattern
URI mask (exact, trailing *, or regex:); null for and an unrestricted .
public string? UriPattern { get; }
Methods
CreateProcessor(IRouteContext)
Compiles the intercept body (its steps as a pipeline). The context wraps route steps with it.
public override IProcessor CreateProcessor(IRouteContext context)
EndIntercept()
Closes the scope and returns to the route it was declared on.
public IRouteDefinition EndIntercept()
SkipSendToOriginalEndpoint()
Do not send to the original endpoint after the intercept steps (only for ).
public InterceptDefinition SkipSendToOriginalEndpoint()
When(Func<IExchange, bool>)
Applies the intercept only when predicate holds.
public InterceptDefinition When(Func<IExchange, bool> predicate)
When(IPredicate)
Applies the intercept only when predicate holds.
public InterceptDefinition When(IPredicate predicate)
When(string)
Applies the intercept only when the route-language condition holds ("property.dryRun").
public InterceptDefinition When(string condition)