[ 
https://issues.apache.org/jira/browse/CAMEL-9971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15299637#comment-15299637
 ] 

James Green commented on CAMEL-9971:
------------------------------------

Other way around - write the content then add the optional append value (which 
might simply be a newline). Lets us use Jackson to JSON-ify an object, write it 
to a file, and see that file as a bunch of JSON documents separated by 
newlines. Perfect for things like logstash to read.

> file2 component should support appending chars in append mode
> -------------------------------------------------------------
>
>                 Key: CAMEL-9971
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9971
>             Project: Camel
>          Issue Type: Improvement
>    Affects Versions: 2.17.0
>            Reporter: James Green
>            Priority: Trivial
>
> I've found some code in a route that writes a message to a file with 
> `fileExist=Append` as an option.
> To my surprise it first goes through a processor that adds a newline 
> character to the end of the text message. It seems our reader (Logstash) 
> requires one-message-per-line in it's input files.
> Of course, if we re-pointed ourselves at a message broker instead of file: 
> the newline-appender processor becomes redundant and thus our code would need 
> to change so it doesn't feel right at all.
> If we had a `appendChars` option we could do `&appendChars=\n` instead on the 
> file endpoint uri which feels more natural.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to