Hi,
Using Camel version 2.15.2, I'm trying to get the Map key as the header in
the CSV file.
Consider the following body:
List<Map<String,String>> body = new ArrayList<Map<String,String>>();
Map<String,String>> map1 = new LinkedHashMap<String,String>();
map1.put("food", "pizza");
map1.put("drink", "coke");
body.add(map1);
Map<String,String>> map2 = new LinkedHashMap<String,String>();
map2.put("food", "burger");
map2.put("drink", "pepsi");
body.add(map2);
And this Java route definition:
from("direct:start")
.marshal().csv()
.to("mock:result");
I would like to produce
food, drink (headers)
pizza, coke
burger, pepsi
I'm currently not able to get the header, I can only produce:
pizza, coke
burger, pepsi
Is this possible?
Thanks
--
View this message in context:
http://camel.465427.n5.nabble.com/Marshalling-a-List-Map-to-CSV-with-headers-tp5770117.html
Sent from the Camel - Users mailing list archive at Nabble.com.