On Mon, Jul 5, 2010 at 3:27 PM, Mattias Severson <mat...@gmail.com> wrote:
>
> Hi,
>
> How do I set the connection timeout when connecting to a remote FTP server?
> I attempt to use the  ftpClient.connectionTimeout of the
> http://commons.apache.org/net/api/org/apache/commons/net/ftp/FTPClient.html
> FTPClient  class. It seem to work if the server uses FTP and FTPS, e.g.
> ftp://u...@host/dir?password=secret&ftpClient.connectionTimeout=30000&disconnect=true&passiveMode=true.
> However, when I try to connect to a remote SFTP server I get an exception:
>
> sftp://u...@host/dir?password=secret&ftpClient.connectionTimeout=30000&disconnect=true&passiveMode=true
> ResolveEndpointFailedException:
> [...]
> There are 1 parameters that couldn't be set on the endpoint. Check the uri
> if the parameters are spelt correctly and that they are properties of the
> endpoint. Unknown parameters=[{ftpClient.connectionTimeout=30000}]
>
> I am using a producer template to transmit the files, e.g.
> producerTemplate.sendBodyAndHeader(uri, file, Exchange.FILE_NAME,
> file.getName());
>

SFTP is based on JCraft JSCH.
http://www.jcraft.com/jsch/

So could you go check their documentation how to set connection
timeout. And report back. Then maybe we can make it easier to set that
for SFTP.



> Camel version: 2.3.0
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Configuration-of-connection-timeout-when-transmitting-files-to-remote-SFTP-server-tp696546p696546.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to