Hi

Sounds like a job for the splitter EIP instead.
http://camel.apache.org/splitter

Then you can use a java method as the splitter expression.
Then you can implement logic to put together beloning lines.



On Thu, Sep 13, 2012 at 9:39 AM,  <klaus.schroe...@ethalon.de> wrote:
> Hello Camel experts
> we are using Camel to read a delimited file and import the data in our
> system. The file has a quite simple structure:
>
> ABF31|01|10503547153|1|9921|90|3|3|20120713|20120713|20120718|0|0|
> ABF37|01|10503547153|1|9921|65|1|1|0||PSB031|20120718||1
> ABF37|01|10503547153|1|9921|75|2|2|0||PSB031|20120718||1
> ABF37|01|10503547153|1|9921|80|2|2|0||PSB031|20120718||1
> ABF31|01|10503547154|1|9921|90|3|3|20120730|20120730|20120815|0|0|
> ABF37|01|10503547154|1|9921|65|1|1|0||PSB031|20120815||1
> ABF37|01|10503547154|1|9921|95|1|1|0||PSB031|20120815||1
> ABF37|01|10503547154|1|9921|100|3|3|0||PSB031|20120815||1
> ABF31|01|10503547155|1|9921|90|3|3|20120730|20120730|20120807|0|0|
> ABF37|01|10503547155|1|9921|75|3|3|0||PSB031|20120807||1
> ...
>
> So we have a abf31 record that has abf37 records as "children". We are
> reading the file using Camel CSV data format and then want to use an
> aggregator to aggregate the rows. The example above should result in 3
> abf31 objects.
> Unfortunately the records do not have a real correlation identifier to be
> used in the aggregator. The aggregation is complete if the next record is
> an abf30 record. In "normal" programming this kind of grouping is quite
> simple, but we did not find an obvious and easy way to do this with Camel
> and aggregators.
>
> As a workaround we now try to insert a correlation id while reading the
> CSV. Is this the recommended way to do it?
>
> Any help is appreciated.
> Klaus
>
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to