|
Hi All,
camel-csv is designed to marshal and unmarshal data from/to csv format.
I notice in the documentation and in the code that the marshal (to csv) is
expected as a Map, but this is in contrast to unmarshalling, which generates
a List<List<String>>.
An example,
Given an arbitrary filter bean, I would expect..
public List<List<String>> doCsvFilter(List<List<String>> csvData) {
// perform business filtering on CSV data
...
return newCsvData;
}
And an example route of this
<from
uri="file:directory/with/csvs?consumer.delay=10000&delete=true"/>
<unmarshal><csv/></unmarshal>
<to uri="bean:myCSVFilterBean?method=doCsvFilter"/>
<marshal><csv/></marshal>
... <!-- other routes -->
but of course, we can only give Maps to <marshal>.
Am I wrong to expect the same in and out ? Is there a better way to filter
CSVs using Camel and another Component (out of the box ?)
Is it possible to get a multi line CSV from marshal by just supplying a Map
? Looking at the code it would seem that it is only designed to generate
Flat (single line) CSV data.
Any suggestions and I will be happy to patch as required.
Cheers
Ramon
|