camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Aggregate exchanges until before EoF
Date Thu, 07 Mar 2013 07:16:43 GMT
On Wed, Mar 6, 2013 at 4:05 PM, cristisor <> wrote:
> Yes, I already used aggregators to build batches of data that I will later
> use for db operations and they work great. But I don't know how to implement
> a custom splitter that, for example, sets the file complet flag only on the
> last split line, is this possible?

Yeah its possible but you would need to write a custom code for that.
You can wrap the existing from Camel and then read the data one-ahead.
And then you would be able to know the the file is EOF when you are at
the 2nd last line.

I guess you want streaming mode, if you are not in streaming mode,
then the splitter has a total size as well.
Then you would know if you are at total - 1 currently.

But in streaming mode the splitter does not know the total size, and
has only current index and if its completed.

PS: There is also a group option on the tokenizer. You may be able to
enhance that existing code to make it discard X last lines.

Not sure if this is a common use-case for others, to be able to group
X lines and discard Y lines at the end.

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

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message