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: 
http://camel.465427.n5.nabble.com/InterceptStrategy-added-to-ToDefinition-is-not-executed-tp5754794.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to