On Wed, Mar 6, 2013 at 4:05 PM, cristisor <[email protected]> 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: > http://camel.465427.n5.nabble.com/Aggregate-exchanges-until-before-EoF-tp5728680p5728689.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
