Hi Dilip, doesn't a single ftp route with fileExist=Move fulfil your requirements? You mention that you use direct routes so starting from a direct route with body set to payload of the new file to be uploaded to the FTP server and CamelFileName header set to the file name:
from("direct:uploadAndBackup").to("ftp:...?fileExist=Move&moveExisting=backup") I think you might be over thinking and creating an overly complex solution for a relatively simple task you need to perform. Checkout the options from file component[1] as they can be used in the ftp component as noted in the fine documentation[2] zoran [1] https://camel.apache.org/file2.html [2] https://camel.apache.org/ftp2.html On Mon, Apr 3, 2017 at 7:31 AM, dilip.pashupathi <dilip.pashupa...@gmail.com> wrote: > 1. At the root folder of the FTP, there is file that needs to be deleted > 2. Before deleting that file, the file should be taken as a backup and > placed in one of the subdirectory. > 3. After that from the request I need read the data and produce a file that > should be placed in the ftp root directory. -- Zoran Regvart