On Sun, Dec 2, 2012 at 4:52 PM, bung_ho <[email protected]> wrote: > Thanks, but are you sure end() is being used to end the route there? It's not > clear to me and I can't find any more documentation on end() anywhere. I saw > this other example and it doesn't look like it's being used to end the route > prematurely the way I'd like to. Note that in the XML version, there is no > such "end" tag. > > http://fusesource.com/docs/router/2.2/eip/BasicPrinciples-ExceptionHandling-doTry.html > > I'd like to try it but I can't find any equivalent way to do it in XML, > which is what we are using. >
I think he refers to <stop/>. Which will stop continue routing an exchange. About the end, then its only available in Java DSL, because you need it in situations to denote an endpoint ro an eip. For example in XML you have <split> ... ... </split> And where </split> marks the end of the split. In Java you can use .end() for that instead split() ... ... .end() > > David J. M. Karlsen wrote >> AFAIK you can end() the route as shown here: >> >> http://camel.apache.org/predicate.html >> Den 30. nov. 2012 01:22 skrev "bung_ho" < > >> bung_ho@ > >> > følgende: >> >>> Using camel 2.10. >>> >>> I have a route similar to the following: >>> >>> >> <route> >>> >> <from uri="file:c:/cameldata/a?doneFileName=GO"> >>> >> <doTry> >>> >> <to uri="bean:utilBean?method=doStuff"/> >>> >> <doCatch> >>> >>> >> <exception> >> java.lang.Exception >> </exception> >>> >>> >> <handled> >> <constant> >> false >> </constant> >> </handled> >>> >> <to >>> >> uri="bean:utilBean?method=doFailStuff"/> >>> >> </doCatch> >>> >> </doTry> >>> >> </route> >>> >>> If multiple files are placed in the directory, then the doneFile GO is >>> placed in it, it will process all of the files sequentially, each going >>> thru >>> the route. Normally this is good. >>> >>> However, what I want to do is stop the batch if there is an exception >>> with >>> one of the files as caught by the >> <doTry> >> <doCatch> >> . Right now, it catches >>> the exception and executes "doFailStuff" but it proceeds to process the >>> remaining files happily, but I don't want that -- I want the entire route >>> to >>> give up there. Is there a way? >>> >>> Hope that's clear. >>> >>> Thanks >>> >>> >>> >>> -- >>> View this message in context: >>> http://camel.465427.n5.nabble.com/how-to-break-out-of-a-batch-tp5723425.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/how-to-break-out-of-a-batch-tp5723425p5723503.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
