onException is only "global" for the same RouteBuilder instance. If you want to reuse that code among multiple route builders, then use java inheritance, and put the shared code in the base class, and call super.configure()
On Wed, Jul 16, 2014 at 6:48 PM, Matt Sicker <[email protected]> wrote: > http://camel.apache.org/exception-clause.html > > So according to the documentation, using an onException inside a > RouteBuilder means that it will apply globally. Now I'm assuming this means > globally within a single CamelContext, first of all. > > However, when I create a RouteBuilder that only has onException > configurations, instantiate it as a bean inside a Blueprint, and use > <contextScan/>, the onException policies I configured in that RouteBuilder > are not being used. If I use an onException policy in the same RouteBuilder > that I define a route, then that policy is indeed used by the routes, but > ONLY in that RouteBuilder. > > Is this a bug in the documentation or Camel? > > -- > Matt Sicker <[email protected]> -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
