You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Babak Vahdat (Commented) (JIRA)" <ji...@apache.org> on 2012/02/10 05:01:59 UTC

[jira] [Commented] (CAMEL-4998) Provide both the connectTimeout and readTimeout options to the SpringWebserviceProducer

    [ https://issues.apache.org/jira/browse/CAMEL-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205207#comment-13205207 ] 

Babak Vahdat commented on CAMEL-4998:
-------------------------------------

My first intention was to provide both the connectTimeout as well as the readTimeout options, however the JDK setConnectTimeout() API itself is "fragile" which is already mentioned [1] in Javadoc as well:

{code}
Some non-standard implmentation of this method may ignore the specified timeout. To see the connect timeout set, please call getConnectTimeout().
{code}

For example for the plain HTTP under Sun-JDK that's the class:

{code}
sun.net.www.protocol.http.HttpURLConnection
{code}

comming into the play which does a really odd way of supporting the timeouts by *duplicating* both the fields

{code}
private int connectTimeout;
private int readTimeout;
{code}

which are *already* declared by it's super-super class:

{code}
java.net.URLConnection
{code}

Other than that the connectTimeout simply didn't behave the way I expected, as setting it even to 1ms didn't bring any SocketTimeoutException or the like. So that at last I will provide only the readTimeout option called timeout.

I think this is the more important option the Camel users can benefit from, as what they really want to specify is how long they want to wait for an answer written into the http socket after the connection has been already established but not neccessarily how log the completion of TCP/IP socket connection would take. That's they want to provide a timeout for how long the WebService is expected to take time for writing into the socket *after* the connect. 

[1] http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setConnectTimeout%28int%29 
                
> Provide both the connectTimeout and readTimeout options to the SpringWebserviceProducer
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4998
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4998
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-spring-ws
>    Affects Versions: 2.9.0
>            Reporter: Babak Vahdat
>            Assignee: Babak Vahdat
>
> See http://camel.465427.n5.nabble.com/How-to-implement-requestTimeout-in-the-spring-ws-component-td5469281.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira