On Thu, Jun 21, 2012 at 10:47 AM, sushil_vsk5 <sushil_v...@yahoo.co.in> wrote:
> Hello,
> I want to know how to add a Global 'interceptFrom()' like construct for all
> routes in a Camel Context. I have say 4 - 5 independent Route Builders
> defined using the  Java DSL which I am adding to a Camel Context defined in
> Spring through the <routebuilder ref=""/> declaration.
>
> Now I want to include a single interceptFrom [Also defined as part of a
> common RouteBuilder using Java] which would intercept all messages coming on
> all routes defined in all the route builders which reside in the context
>
> Unfortunately, the interceptFrom() only seems to intercept messages for
> those routes which are defined in the same RouteBuilder class as the
> interceptFrom() itself. Is there a way to intercept messages for all
> incoming messages for all routes that the camel context holds?
> Regards,
> Sushil
>

You can have a base RouteBuilder class (extending the Camel
RouteBuilder) where you add the global stuff.

And then extend this class from your routes, and invoke the super.
configure() method first, so the base class code is included.


> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Global-Interceptor-for-all-incoming-Messages-tp5714820.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to