Class OnCompletionDefinition
Steps that run after the route has finished with an exchange (Camel onCompletion): audit,
notifications, cleanup. They receive a copy of the exchange, run outside the route's
transaction and error handlers, and never change the route's own result. As in Camel, they run in the
caller once the route has finished, and the caller waits for them; or
runs them on a bounded pool of their own instead, and
runs them before the consumer gets the reply (HTTP / SOAP, where the reply
is the consumer's job). A block after the consumer never gets the caller's cancellation: an aborted request
does not cut it half way.
Declared on a route or on the RouteBuilder for every route it defines.
public sealed class OnCompletionDefinition : RouteDefinitionBase<OnCompletionDefinition>, IRouteDefinition, IProcessorDefinition, IRouteScope
Inheritance
Implements
Inherited Members
Properties
BeforeConsumer
Run before the consumer receives the reply instead of asynchronously after it.
public bool BeforeConsumer { get; }
Condition
Optional condition evaluated on the copy; when it does not hold the steps are skipped.
public IPredicate? Condition { get; }
ExecutorServiceName
The thread pool profile the block's pool is built from; null for the default profile.
public string? ExecutorServiceName { get; }
IsParallelProcessing
Whether the block runs on a pool of its own instead of in the caller (Camel parallelProcessing).
public bool IsParallelProcessing { get; }
Methods
CreateProcessor(IRouteContext)
Compiles the completion steps as a pipeline; the context runs it after the route.
public override IProcessor CreateProcessor(IRouteContext context)
EndOnCompletion()
Closes the scope and returns to the route it was declared on.
public IRouteDefinition EndOnCompletion()
ExecutorService(string)
Run the block on a pool of its own built from the named thread pool profile (Camel executorService, which
public OnCompletionDefinition ExecutorService(string name)
ModeBeforeConsumer()
Run synchronously before the consumer receives the reply.
public OnCompletionDefinition ModeBeforeConsumer()
OnFailureOnly()
Run only after a failed exchange (the exception is on the copy).
public OnCompletionDefinition OnFailureOnly()
ParallelProcessing()
Run the block on a pool of its own built from the context's default thread pool profile, so the caller does not
public OnCompletionDefinition ParallelProcessing()
When(Func<IExchange, bool>)
Run only when predicate holds.
public OnCompletionDefinition When(Func<IExchange, bool> predicate)
When(IPredicate)
Run only when predicate holds.
public OnCompletionDefinition When(IPredicate predicate)
When(string)
Run only when the route-language condition holds ("header.audit").
public OnCompletionDefinition When(string condition)