You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by livensn <ni...@gmail.com> on 2011/09/22 13:44:56 UTC
Camel onException()
Hi all,
In our project, we need to validate a csv file, we do this in a camel route.
But if something is wrong with the csv, we throw an exception.
Is it possible to stop the route right after this exception is thrown?
We've tried onException(RuntimeException.class).stop()
We've tried onException(RuntimeException.class).maxmimumRedeliveries(0)
Any help is appreciated.
Thanks
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-onException-tp4829847p4829847.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel onException()
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
See the FAQ :)
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html
On Thu, Sep 22, 2011 at 1:44 PM, livensn <ni...@gmail.com> wrote:
> Hi all,
>
> In our project, we need to validate a csv file, we do this in a camel route.
>
> But if something is wrong with the csv, we throw an exception.
> Is it possible to stop the route right after this exception is thrown?
>
> We've tried onException(RuntimeException.class).stop()
> We've tried onException(RuntimeException.class).maxmimumRedeliveries(0)
>
> Any help is appreciated.
>
> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-onException-tp4829847p4829847.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Camel onException()
Posted by Christian Müller <ch...@gmail.com>.
You have to configure your file component to move the failed file into
another directory. Look for the file2 component documentation for details.
Christian
Sent from a mobile device
Re: Camel onException()
Posted by livensn <ni...@gmail.com>.
Thanks for your answer Ngoc,
We tried that already. But nothing seems to work.
Our route retries to consume the same file over and over again until it
reaches its timeout.
Any other suggestions?
Thanks
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-onException-tp4829847p4829901.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel onException()
Posted by Pham Ngoc Hai <pn...@yahoo.com>.
Hi,
You my want to try to put your onException to route scope and don't forget to add an end() to your onException sub
from()
.onException()....stop().end()
.to()
.to();
Regards,
Ngoc Hai
--- On Thu, 9/22/11, livensn <ni...@gmail.com> wrote:
> From: livensn <ni...@gmail.com>
> Subject: Camel onException()
> To: users@camel.apache.org
> Date: Thursday, September 22, 2011, 6:44 PM
> Hi all,
>
> In our project, we need to validate a csv file, we do this
> in a camel route.
>
> But if something is wrong with the csv, we throw an
> exception.
> Is it possible to stop the route right after this exception
> is thrown?
>
> We've tried onException(RuntimeException.class).stop()
> We've tried
> onException(RuntimeException.class).maxmimumRedeliveries(0)
>
> Any help is appreciated.
>
> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-onException-tp4829847p4829847.html
> Sent from the Camel - Users mailing list archive at
> Nabble.com.
>