1

In Apache Camel, how to configure the data port range for FTP Client Active mode?

I am going to set up a FTP client and have to limit the port range for active mode due to existence of firewall. However, I cannot see an option in the list of FTP module mention the port range setting.

http://camel.apache.org/ftp2.html

hk6279
  • 1,881
  • 2
  • 22
  • 32

1 Answers1

2

There isn't any. You can manipulate the ftpClient options through the URI, e.g.

from("ftp://foo@myserver?password=secret&ftpClient.dataTimeout=30000").to("bean:foo");

However, FTPClient doesn't have proper setter methods for the active port range - it only has the setActivePortRange method which accepts two integer parameters.

You will have to configure your own FtpClient and use it in the route by leveraging the ftpClient parameter:

from("ftp://foo@myserver?password=secret&ftpClient=#myFtpClient").to("bean:foo");
Miloš Milivojević
  • 5,219
  • 3
  • 26
  • 39
  • 2
    We should make this easier. I have logged a ticket to add support for activePortRange option: https://issues.apache.org/jira/browse/CAMEL-10246 – Claus Ibsen Aug 16 '16 at 11:27