One Star

httprequest timeout

Hey guys,
I need to do a Httprequest and be able to make it timeout after a number of seconds.
I'm using thttprequest but it doesn't seam to timeout EVER Smiley Happy
Anybody had the same issue and found something ?
Thanks a lot
5 REPLIES
Community Manager

Re: httprequest timeout

Hi
Thanks for your post, I think it should be a feature, we should add a timeout parameter on the component. Would you like to report a feature on our bugtracker?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: httprequest timeout

Thanks Shong,
I will report it as a feature.
I wrote a bit of Java code using tjava to do a httprequest instead with a timeout.
If anyone interested :
java.net.URL url = new java.net.URL("http://www.google.com");
java.net.HttpURLConnection urlconn = (java.net.HttpURLConnection)url.openConnection();
urlconn.setConnectTimeout(100000);
urlconn.setReadTimeout(100000);
//urlconn.setInstanceFollowRedirects(false);
urlconn.setRequestMethod("GET");
try {
urlconn.connect();
java.io.BufferedReader buf = new java.io.BufferedReader(new java.io.InputStreamReader(urlconn.getInputStream()));
java.lang.String line;
java.lang.StringBuilder text = new java.lang.StringBuilder();
while((line = buf.readLine()) != null)
text.append(line);
text.append('\r');
row3.data=text.toString();
} catch (java.net.SocketTimeoutException e){
System.out.println("connection timeout !");
}

Thanks
One Star

Re: httprequest timeout

I have the same problem.
Any plans to add a timeout option in the http request component in the near future ?
One Star

Re: httprequest timeout

Jira still open since November 2011 :-(
Jira link
Community Manager

Re: httprequest timeout

This feature will be available since version 6.2.0, see this jira issue:
https://jira.talendforge.org/browse/TDI-31934
----------------------------------------------------------
Talend | Data Agility for Modern Business