Thanks for the info, I'll keep that in mind. I can't switch to camel 2.0, I'm doing this via Progess Servicemix 3.4, which uses Camel 1.6.1. Maybe a documentation update is in order in that it should state that the onException should immediately follow a from().
Claus Ibsen-2 wrote: > > On Tue, Aug 18, 2009 at 6:19 PM, Bob Yetman<[email protected]> wrote: >> >> I've been expermenting with camel 1.6.1, and come across a problem/bug >> with >> OnException. >> >> With the following route (greatly simplified for testing) everything >> works >> as expected and a file put into input shows up into output, and nothing >> shows up in the exception directory: >> >> <route> >> <from uri="file:///c:/temp/input"></from> >> <onException> >> <exception>java.lang.Exception</exception> >> <handled><constant>true</constant></handled> >> <to uri="file:///c:/temp/exception"> >> </onException> >> <to uri="file:///c:/temp/output"></to> >> </route> >> >> However, when I have OnExceptions inside of multicast, things don't quite >> work as expected, the input >> file ends up in output & output2 as expected, but it also ends up in the >> exception and exception2 directorys, which shouldn't happen, since no >> exception is thrown in the route : >> >> <route> >> <from uri="file:///c:/temp/input"></from> >> <multicast> >> <pipeline> >> <onException> >> <exception>java.lang.Exception</exception> >> <handled><constant>true</constant></handled> >> <to uri="file:///c:/temp/exception"> >> </onException> >> <to uri="file:///c:/temp/output"></to> >> </pipeline> >> <pipeline> >> <onException> >> <exception>java.lang.Exception</exception> >> <handled><constant>true</constant></handled> >> <to uri="file:///c:/temp/exception2"> >> </onException> >> <to uri="file:///c:/temp/output2"></to> >> </pipeline> >> </multicast> >> </route> >> >> Three possibilites come to mind: >> >> 1. I've got something wrong in the route > > Yeah see #2 and #3. > And try it with Camel 2.0 as we have improved it a lot over 1.x. > > >> 2. It's a bug in multicasting/onexception > > Could be but the onException is not designed to be scatter everywhere > as you please. See #3. > >> 3. I'm just not understanding something correctly. >> > > Setting onException on a route is meant to be set in the start of the > route, eg just after from(). > > >> Any help would be appreciated. >> >> >> >> -- >> View this message in context: >> http://www.nabble.com/Multicast---OnException----Bug--%28camel-1.6.1%29-tp25028431p25028431.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > > > > -- > Claus Ibsen > Apache Camel Committer > > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > > -- View this message in context: http://www.nabble.com/Multicast---OnException----Bug--%28camel-1.6.1%29-tp25028431p25065980.html Sent from the Camel - Users mailing list archive at Nabble.com.
