Reputation: 5
how can write a liste of line into a file in Apache Camel ?
<to id="getdata" uri="sql-stored:{{sql.comptes}}?dataSource=dataSource" />
<to uri="bean:Converter" />
<to id="fileWriter" uri="file:{{data.out}}?fileName=Comptes-${date:now:yyyyMMdd'T'HHmmss'T'SSS}.txt" />
no file is created.
Upvotes: 0
Views: 1884
Reputation: 1661
The file endpoint expects exchange body to be something that can be serialized to the byte array. If you need a list of strings (like one line per string) in the file you need to convert exchange body from list of strings to just string for example (by concatinating strings with newline char).
Upvotes: 1