camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramon Buckland" <ra...@thebuckland.com>
Subject Query regarding camel-csv
Date Fri, 05 Dec 2008 10:37:23 GMT
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&amp;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

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