camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: onException at route level to configure drop location per route
Date Mon, 15 Oct 2012 17:33:20 GMT
If you look for a route scoped exception clause [1], your route has to look
like:

from("..")
  .onException(Exception.class)
    .process("...")
    .to("...")
  .end()
  .process(processor)
  .to("..");

If you need a more fine grain solution, split your route or use the
try-catch-finally support in Camel [2]. [3] gives you a good overview with
helpful links.

[1] http://camel.apache.org/exception-clause.html
[2] http://camel.apache.org/try-catch-finally.html
[3] http://camel.apache.org/error-handling-in-camel.html

Best,
Christian

On Mon, Oct 15, 2012 at 2:08 PM, bharathramesh <bharathramesh@hotmail.com>wrote:

>    from(
>               fromLocation)
>               .filter().method(
>               new MyFilter(constant),
>               "isValid").process(
>               new MyParser()
>                       .onException(
>                               Exception.class).log(
>                                       LoggingLevel.ERROR, "Error in
> Authentication").onWhen(
>                                       exceptionMessage().contains(
>
> FTP_AUTHENTICATION_FAIL_CODE)).maximumRedeliveries(
>                                       0).process(
>                                       new ExceptionProcessor()).handled(
>                                       true)
>                                       .to(getDropLocation(airport,
> fromLocation)).end()
>                       .onException(
>                               SSIM7FormatException.class,
> SSIM7ParserException.class).log(
>                                       LoggingLevel.ERROR, "Error in
> Parsing").maximumRedeliveries(
>                                       0).process(
>                                       new ExceptionProcessor()).continued(
>                                       true)
>                                       .to(getDropLocation(airport,
> fromLocation)).end()
>                       . onException(
>                               Exception.class).log(
>                                       LoggingLevel.ERROR, "Error in
> polling").process(
>                                       new
> ExceptionProcessor()).maximumRedeliveries(
>                                       2).redeliveryDelay(
>                                       25000).continued(
>                                       true)
>                                       .to(getDropLocation(airport,
> fromLocation)).end().aggregate(
>               constant(true), new TarballAggregationStrategy())
>               .completionPredicate(body().isNull())
>               .to(
>                       "direct:Result_" + airport).routeId(
>                       routeID);
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/onException-at-route-level-to-configure-drop-location-per-route-tp5721056p5721061.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message