hk6279
hk6279

Reputation: 1879

Apache Camel - How to configure the data port range for FTP Client Active mode

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

Upvotes: 1

Views: 744

Answers (1)

Miloš Milivojević
Miloš Milivojević

Reputation: 5369

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");

Upvotes: 2

Related Questions