camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mattias Severson <>
Subject Re: Configuration of connection timeout when transmitting files to remote SFTP server?
Date Wed, 07 Jul 2010 11:13:21 GMT

Hmm, maybe I was to hastily to reply and file the issue yesterday. It turned
out that there is also a connection timeout on the JCH
Channel  class, which is super class to the
ChannelSftp  (via the
ChannelSession  class. 

That said, I have not been able to get any timeout what so ever using JSCH.
When I execute the the code below, I don't get passed the
"channel.connect(5000);" statement and it does not timeout...

File file = new File("toBeSent.txt");
JSch jsch = new JSch();

File knownHosts = new File("/home/.ssh/known_hosts");
jsch.setKnownHosts( knownHosts.getAbsolutePath() );
Session session = jsch.getSession("user", "");

Channel channel = session.openChannel( "sftp" );
ChannelSftp sftpChannel = (ChannelSftp) channel;
sftpChannel.put(file.getAbsolutePath(), file.getName());
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message