Skip to main content

Fetch files from SFTP server

Camel has the SFTP component (see Camel documentation) that enables fetching files from SFTP server. A simple SFTP route fetching files can look like this:

<routes xmlns="">
  <route id="example.sftp.fa">
    <from uri="sftp://fa@;password=1234&amp;reconnectDelay=10000&amp;delay=60000&amp;disconnect=true&amp;delete=true" />
    <to uri="file:{{back.writable.dir}}/integrations/custom?autoCreate=true" />

The above route:

  • Fetches files from SFTP server "" directory (authenticating with username and password, polling once every 60 seconds).

  • Places the file to the /integrations/custom FA directory.

  • Deletes the files from SFTP after successful processing.

You might need to apply other SFTP connection parameters as well depending on the requirements of the SFTP server you connect to.