Sidebar

How do you append to a file when using FTP as the destination node?

0 votes
825 views
asked Nov 19, 2015 by marc-m-9513 (570 points)

1 Answer

0 votes

It looks like there is an option within camel FTP, which QIE uses (see http://camel.apache.org/file2.html).

Try adding the following Custom Apache Camel parameter:

fileExist=Append

See the following example:

 CamelFTPAppend

I am unsure of the performance of this option.  If performance becomes an issue, I recommend appending to the file locally, and then uploading the file with a separate channel at a certain interval.

answered Nov 19, 2015 by mike-r-7535 (13,830 points)
commented Jul 31, 2019 by connor-s-5867 (120 points)
When using this method it seems to concatenate the last segment of message one with the first segment of message 2 without a carriage return. Is there any additional code that can be added to address this?
commented Jul 31, 2019 by brandon-w-8204 (33,270 points)
You will need to append the carriage returns to your message content before you send it. Depending on your message type depends on what you need to do. Most likely you need to convert to a plain text message and append \r to the front of your message.

message = qie.createTextMessage('\r\r' + message.getNode('/'));
...