Could you have a look at [1]? There are many tests which make sure it works. And if it doesn't work for you, could you please attach a test which indicate this. With a test it's much more easier for us to check what's going wrong - in your code or in Camel. And at the end, you will have a solution in a shorter time.
[1] https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/ Best, Christian On Mon, Jul 16, 2012 at 6:20 PM, smadarapu <srikanth.madar...@adp.com>wrote: > Hi Christian, > > If you read my initial post, my question is what am I missing. I had what > you suggested but its not working. > Christian Mueller wrote > > > > It's documented here [1]. > > > > You can e.g. do: > > from("direct:start") > > > > > .onException(MyTechnicalException.class).maximumRedeliveries(0).handled(true).end() > > > > > .onException(MyFunctionalException.class).maximumRedeliveries(0).handled(true).to("bean:myOwnHandler").end() > > .choice() > > .when().xpath("//type = 'myType'").to("bean:myServiceBean") > > .end() > > .to("mock:result"); > > > > > > [1] http://camel.apache.org/exception-clause.html > > > > Best, > > Christian > > > > On Fri, Jul 13, 2012 at 5:57 PM, smadarapu > > <srikanth.madarapu@>wrote: > > > >> Can you please elaborate "A route can have a N+ route scoped > >> onException's. > >> That is possible." > >> > >> In my case when I had the onException on the route, whatever the code i > >> put > >> for onException got executed immediately after a message arrived to that > >> route (without an actual exception), and not when that exception really > >> happened. > >> > >> -- > >> View this message in context: > >> > http://camel.465427.n5.nabble.com/Exception-handling-in-Camel-Routes-tp5715952p5716018.html > >> Sent from the Camel - Users mailing list archive at Nabble.com. > >> > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Exception-handling-in-Camel-Routes-tp5715952p5716089.html > Sent from the Camel - Users mailing list archive at Nabble.com. >