You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jmh <je...@nrb.be> on 2011/01/07 11:06:56 UTC

Alert by mail onException...but only one mail

Hello,

first of all, best wishes for 2011 and long life to Camel !

My question is :

I have a route which consumes a text file (from("file:...")) containing some
lines (with "\n" as separator)


Suppose I have a problem when I'm processing a line in my route and it
remains 1000 lines to process, how can I onException (see below) send only
one alert mail and not 1000 mails with the same exception ?

onException(MyProcessException.class).to(smtpTechnicalSupport);

Thanks for solution

JM

-- 
View this message in context: http://camel.465427.n5.nabble.com/Alert-by-mail-onException-but-only-one-mail-tp3331622p3331622.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Alert by mail onException...but only one mail

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can use onCompletion on the route.
http://camel.apache.org/oncompletion.html

Then that will be invoked once the route is complete (eg after the
splitter is done)

The caused exception is stored as a property on the Exchange if you
want to grab it.



On Fri, Jan 7, 2011 at 11:06 AM, jmh <je...@nrb.be> wrote:
>
> Hello,
>
> first of all, best wishes for 2011 and long life to Camel !
>
> My question is :
>
> I have a route which consumes a text file (from("file:...")) containing some
> lines (with "\n" as separator)
>
>
> Suppose I have a problem when I'm processing a line in my route and it
> remains 1000 lines to process, how can I onException (see below) send only
> one alert mail and not 1000 mails with the same exception ?
>
> onException(MyProcessException.class).to(smtpTechnicalSupport);
>
> Thanks for solution
>
> JM
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Alert-by-mail-onException-but-only-one-mail-tp3331622p3331622.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
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/