In the Apache CXF HTTPClientPolicy.setConnectionTimeout()
and HTTPClientPolicy.setReceiveTimeout()
methods, are the parameters in seconds or milliseconds? It seems trivial, but I can't find the answer anywhere, to begin with the javadoc...
As I know all web services timeouts is configured in milliseconds, I did not see anywhere that the timeout would be configured in seconds. In your case there is a documentation from XSD
of:
{http://cxf.apache.org/transports/http/configuration}HTTPClientPolicy
ConnectionTimeout:
Specifies the amount of time, in milliseconds, that the consumer will attempt to establish a connection before it times out. 0 is infinite.
This refers here.
Ok, I finally found it. These methods take values in milliseconds. I found the answer here:
http://lhein.blogspot.fr/2008/09/apache-cxf-and-time-outs.html?showComment=1328760737362#c5269809084998987761
The only hint is that it uses a long
which in Java is usually in milliseconds, but clearly the unit is not documented anywhere.
The method setConnectionTimeout
should have been named setConnectionTimeoutMillis
and the JavaDoc should have mentioned this somewhere. Developers should do this whenever a unit is involved.
Maybe Java should have had some kind of typed number like Long<MilliSeconds>
and numbers of the wrong 'unit' would be refused by the compiler :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With