camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: InterceptStrategy added to ToDefinition is not executed
Date Tue, 05 Aug 2014 13:26:28 GMT

See this page

And then only wrap the processor "when you want to do it"

On Tue, Aug 5, 2014 at 2:47 PM, spa <> wrote:
> Hello all,
> I have a question regarding InterceptStrategies. I'd like to add an
> InterceptStrategy that only intercepts a specific processing step (kind of
> an Around advice). After reading and trying a few things I have a solution
> that works by adding the InterceptStrategy during the
> addRoutesToCamelContext() call of the RouteBuilder class:
>         configureRoutes((ModelCamelContext) context);
>         for (RouteDefinition myRoute : getRouteCollection().getRoutes())
>         {
>                 myRoute.addInterceptStrategy(myStrategy);
>         }
>         populateRoutes();
> The problem is of course that this approach leads to the interception of all
> processing steps. I'm currently handling this inside my interceptor, but I'd
> like a better solution, so I looked a bit further and saw that it is
> possible to add an InterceptStrategy to a ToDefinition. Thus I created a
> ToDefinition on my own, wrapping my target URI, adding my InterceptStrategy
> and added it via addOutput(). Unfortunately, the interceptor is never
> executed and I don't know why. Has anyone experienced a similar situation or
> is there another way to achieve what I like to achieve?
> Thanks in advance
> Sven
> PS.: I am using Camel 2.13.1
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message