camel-csv - Marshal support List<Map>
-------------------------------------

                 Key: CAMEL-2006
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2006
             Project: Apache Camel
          Issue Type: Improvement
    Affects Versions: 2.0.0, 1.6.1
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
            Priority: Minor
             Fix For: 2.1.0


If you want to write 2+ rows of data to CSV using camel-csv you may need to 
loop it. What we should support is that you can provide data as List<Map> for 
each row

{code}
        Map<String, Object> row1 = new LinkedHashMap<String, Object>();
        row1.put("orderId", 123);
        row1.put("item", "Camel in Action");
        row1.put("amount", 1);
        data.add(row1);

        Map<String, Object> row2 = new LinkedHashMap<String, Object>();
        row2.put("orderId", 124);
        row2.put("item", "ActiveMQ in Action");
        row2.put("amount", 2);
        data.add(row2);
{code}

So you can output it as
{code}
123,Camel in Action,1
124,ActiveMQ in Action,2
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to