> Need help adding newline while writing to the file. > I am writing very large file using Apache Camel's File Component. > I am using StringBuffer to store very large string and then passing (passing > string ex.getIn().setBody(stringbuffer.toString()); ) it to the > file endpoint (<to uri="file:c://cameldata/loanet/outbound"/>)
What about using Stream component [1] for that purpose? Instead of caching lines in StringBuffer you can send them to the file as they arrive. from("seda:linesQueue").to("stream:file?fileName=outputFile"); This is more message-oriented-middleware way of handling large output files :) . [1] http://camel.apache.org/stream.html -- Henryk Konsek http://henryk-konsek.blogspot.com