camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klaus.Schroe...@ethalon.de
Subject Aggregation with read-ahead?
Date Thu, 13 Sep 2012 07:39:39 GMT
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




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message