camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: What does 'Exchange ending ' mean
Date Wed, 18 Jan 2012 16:54:43 GMT

On Wed, Jan 18, 2012 at 12:03 AM, anand sridhar <> wrote:
> I was hoping the community could help me understand the exact meaning of
> 'Exchange ending' as mentioned in Camel Docs about
> DefaultErrorHandler<>

The error handling documentation at Apache is a bit .. well not so
well structured.

"ends" means that the message will not continue being routed. So the
routing breaks where the exception occurred, and the exception is
propagated back to the consumer/caller.

> For example, my route is as below -
> from("ftp://x.x.x.x.?consumer.delay=30000").
> .unmarshall().csv()
> .to("endpoint1")
> .to("endpoint2")
> .to("endpoint3")
> .end();
> The above route polls a FTP location for files every 30 seconds.  If at a
> certain instant , one of the stages of the route throws exception, will
> polling continue further. ?
> If not, could  some one advise the best strategy to continue polling. ?

The FTP consumer is also a batch consumer

Which means it pickup X inputs in a batch (eg a FTP consumer detects X
number of files to download).
And then it processes each file one by one, from the batch.

So if one file fails to process and an exception is thrown. Then by
default the FTP consumer will continue with the next file and so on.

Error handling is a hard topic to get right. And there is no one-shoe
size that fits all. So there is many knobs you can customize with

Camel in Action book, chapter 5, has 34 pages all about error handling.

> Thanks,
> Anand

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message