The FTP component calls external servers using the FTP, FTPS or SFTP protocol. Learn how to use the FTP component.


To install camel-ftp you can use the managed libraries or manually upload the library jars with their dependencies.

Endpoint configuration

Depending on the server, the connection may not be working with the default parameters. Check the following parameters:

  • stepwise parameter : default is true, but false often works better
  • separator parameter : specify the server type, either UNIX or Windows
  • path can be specified as absolute, eg sftp://login@server//var/data will look at files in /var/data

See the FTP component documentation for the others settings

SFTP authentication

The SFTP authentication can be done either by password (simply use the password parameter in endpoint uri) or by certificate.

In order to use the certificate authentication you first ensure that the SSH server you want to connect to is configured in a such way. Then get the private key that correspond to the authorized certificate. This file has the following format (same format than OpenSSH key files):


or when it is encrypted by a passphrase (in this case you also need the associated passphrase)

Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,9AD7FB0A171195D7F2A832E474BE3F7D


There is two alternative to store the private key file:

On file system

  1. Copy the private key to a file that is accessible by the Decision Insight process (eg /home/decision-insight/sftp-key.pem). 
  2. Then, add the following parameters to the endpoint configuration:
    • privateKeyFile to designate the key file to be used, eg  privateKeyFile=/home/decision-insight/sftp-key.pem
    • privateKeyPassphrase only if the retrieve private key is protected by a passphrase, eg  privateKeyPassphrase=secret

For example:

 <from uri="sftp://login@server//var/data/queue?privateKeyFile=/home/decision-insight/sftp-key.pem&amp;privateKeyPassphrase=secret"/>

(minus) You need to have access to the server filesystem to write the key file

(plus) The private key won't be exposed in export file, database file nor database backups

In embedded database

  1. Create a new resource in Data Integration, for example, sftp-key. Copy/paste the file content in the resources. 
  2. Then, add the following parameters to the endpoint configuration:
    • privateKeyUri to designate the key file to be used, eg  privateKeyUri=tnd-resource/sftp-key
    • privateKeyPassphrase only if the retrieve private key is protected by a passphrase, eg  privateKeyPassphrase=secret

For example:

 <from uri="sftp://login@server//var/data/queue?privateKeyUri=tnd-resource/sftp-key&amp;privateKeyPassphrase=secret"/>

(plus) You don't need access to the server file system, can be done completely from the GUI

(minus) The private key will be written in export file, in database file and database backups

Route sample

This example will print the file content of the retrieved files:

<routes xmlns:u="http://www.systar.com/aluminium/camel-util" xmlns="http://camel.apache.org/schema/spring">
        <from uri="sftp://login@server//var/data/queue?privateKeyUri=tnd-resource/sftp-key&amp;privateKeyPassphrase=secret&amp;idempotent=true"/>
        <convertBodyTo type="java.lang.String"/>
        <to uri="log:test"/>

Related Links