public interface InterceptStrategy
AsyncProcessor
as the returned wrapped
Processor
which ensures the interceptor works well with the asynchronous routing engine.
You can use the DelegateAsyncProcessor
to easily return an
AsyncProcessor
and override the
AsyncProcessor.process(org.apache.camel.Exchange, org.apache.camel.AsyncCallback)
to
implement your interceptor logic. And just invoke the super method to continue routing.Modifier and Type | Method and Description |
---|---|
Processor |
wrapProcessorInInterceptors(CamelContext context,
ProcessorDefinition<?> definition,
Processor target,
Processor nextTarget)
This method is invoked by
ProcessorDefinition.wrapProcessor(RouteContext, Processor)
to give the implementor an opportunity to wrap the target processor
in a route. |
Processor wrapProcessorInInterceptors(CamelContext context, ProcessorDefinition<?> definition, Processor target, Processor nextTarget) throws Exception
ProcessorDefinition.wrapProcessor(RouteContext, Processor)
to give the implementor an opportunity to wrap the target processor
in a route.
Important: See the class javadoc for advice on letting interceptor be compatible with the
asynchronous routing engine.context
- Camel contextdefinition
- the model this interceptor representstarget
- the processor to be wrappednextTarget
- the next processor to be routed toException
- can be thrownApache Camel