CSV
The CSV Data Format uses Apache Commons CSV to handle CSV payloads.
Marshalling a Map to CSV
The component allows you to marshal a Java Map (or any other message type that can be converted in a Map) into a CSV payload.
An example: if you send a message with this map...
... through this route ...
... you will end up with this CSV message
foo,bar
Sending the Map below through this route will result in a CSV message that looks like foo,bar
Unmarshalling a CSV message into a Java List
Unmarshalling will transform a CSV messsage into a Java List with CSV file lines (containing another List with all the field values).
An example: we have a CSV file with names of persons, their IQ and their current activity.
We can now use the CSV component to unmarshal this file:
The resulting message will contain a List<List<String>>
: