camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihullu <>
Subject splitter, enricher, aggregator
Date Sat, 04 May 2013 21:53:01 GMT
I would like to do the following:

1. read a csv file
2. split it per line
3. per line enrich it with data coming from a xml source
4. per line execute a REST call to store the line 

As I have a pure Java background an no Spring experience I used the Java

This is what I created so far: 

           .to("log: IN ==>")
           .to("log: JAXB ==>")
           .setHeader("id", simple("${}")).log("id =
           //.to("log: END ==>")

The input is: 

      String inMsg = "0196-SJCLPAD2SGG\t112\n" + 

I am stuck at the Enrich part. It has the xml file as an input and uses the
Aggregation class to do the enrichment. The problem is that it consumes the
entire xml file. In the AggregationStrategy class I can browse through the
file and select the correct element by matching on the id field. This does
not sound very nice to me because the xml file is rather big. I do not want
to have the entire file in memory. 

I was actually looking for something like this. I want to do a
lookup/selection based on the field in the XML file
(PRD-ontrail.prd) prior to the the polEnrich and enrich it with some
additional fields. 


Read File -> Split per line -> create Product Bean -> Add header
|                                    |-> enrich
V                                   |
Select element from XML-------- 
using header/id

I hope this is clear what I want. 

Can somebody help me figure this out?


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

View raw message