Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFTPConnection | How to set a connection timeout?

I'm looking to set a connection timeout for the tFTPConnection component.

The SFTP server we're connecting to requires more than the default 20 seconds for a connection... Increasing timeout settings in a straight-up linux SFTP call, or through filezilla, works like a charm.

I'd like to try increasing the timeout in my Talend job to see if that works, but I can't find that option anywhere in the tFTPConnection component.

I am using TOS for Data Integration v6.2.1.

I've tried looking at https://help.talend.com/search/all?query=tFTPConnection, with no luck, and searches in these forums haven't been successful yet.

Thanks in advance for any help!

Labels (2)
9 Replies
TRF
Champion II
Champion II

Hi,

I think you need to elaborate your own try / catch strategy to retry a fixed times when Ftp connection fails.

Regards,
TRF
Anonymous
Not applicable
Author

Hi TRF,
Not sure that I follow...  I'm happy to retry the connection, but it looks like connecting to the SFTP server requires more than 20 seconds in general.  So any retries will continue to fail unless I can tweak the connection timeout on the client side.  Changing the server side is not an option in my case.
I'm not sure how to tweak the connection timeout - any guidance on that would be awesome.
Thanks!
TRF
Champion II
Champion II

You're right, sorry.
Can't find the feature to change the timeout default value.
Anonymous
Not applicable
Author

@TRF quite all right, I really appreciate your responding at all.

Right now I'm looking at extending the tFTPConnection component, since the generated code produces these lines...


				com.jcraft.jsch.Channel channel_tFTPConnection_1 = session_tFTPConnection_1
.openChannel("sftp");
channel_tFTPConnection_1.connect();



I'll then update that second line to something like...

				channel_tFTPConnection_1.connect(TIMEOUT_VALUE);



... based on the what the library permits, as seen at...

https://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/Channel.html#connect-int
cterenzi
Specialist
Specialist

Good luck!  Let us know if it works for you, please.
Anonymous
Not applicable
Author

Hi,
Here is a new feature jira issue: https://jira.talendforge.org/browse/TDI-37257.
Best regards
Sabrina
Anonymous
Not applicable
Author

@here

I hacked it for my first pass, by going to...


[PATH_TO]\Talend_Open_Studio_Data_Integration-V6.2.1\plugins\org.talend.designer.components.localprovider_6.2.1.20160704_1411\components\tFTPConnection



Cut into the following file...


tFTPConnection_begin.javajet



For my version of the file, it contained this on line 170...


	channel_<%=cid%>.connect();



And as a dirty hardcoded hack I updated it to...


	channel_<%=cid%>.connect(60000);



... which worked perfectly.

All other FTP components using this connection were fine, of course, which limited my change to just the tFTPConnection component.

My next step will be to add in the value as a configuration option, but that's looking like a pretty trivial exercise at this point.

For what it's worth, this page (and its links) helped me tremendously...

https://www.talendbyexample.com/talend-custom-component-writing.html

Thanks folks for the interest, hopefully this will help others if they needed it.

It's worth noting that this was for a SFTP connection.  I don't know that this approach would necessarily work as-is for other FTP connections (I think they may use different libraries).
TRF
Champion II
Champion II

Can't find the "like" button, sorry
cterenzi
Specialist
Specialist

TRF wrote:
Can't find the "like" button, sorry

This.  Good job, cheesedumpling!