camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Bindy - Avoiding bindy to discard a chunk of data when one line has incorrect format
Date Fri, 27 Jan 2012 16:04:43 GMT
On Fri, Jan 27, 2012 at 3:19 PM, Aida <> wrote:
> Hi,
> I'm working with bindy to process a file. I use a splitter (something
> similar to what it is said here by Claus:
> so I can send chunks of data in parallel.
> The thing is that, if in a (csv) file I have one column in a line with an
> incorrect format, bindy throws an Exception and the chunk is lost. I wanted
> to know if it's possible to configure something so bindy discards only that
> line and keeps processing the other lines that comes in the chunk (so I only
> loose the line with a bad format).

If you split the file on a line-by-line basis (such as tokenizer with
\n), then the splitter will by default process all the lines.
And only at the end thrown an exception if one of the lines failed.

You can then configure an onException, to catch those exceptions and
just ignore by handling the exception.

Maybe something alike this which logs what line failed.

onException(Exception.class).handled(true).log("This line failed with
data ${body}");

> Thanks in advance.
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

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

View raw message