AsyncHttpClient Connection Timeout not working

4.1k views Asked by At

I'm using AsyncHttpClient to make HTTP request through proxy server, but seems connect timeout not working, even if I configured it to be 65 seconds (proxies can work very slow).

I'm receiving java.util.concurrent.ExecutionException backed by java.net.ConnectException (i.e. application don't wait until proxy server return response) after 0-20 secs (i.e. timeout is random every time)

   Integer timeout = 65000 // 65 secs
   AsyncHttpClientConfig cfg = new AsyncHttpClientConfig.Builder( ).
                setConnectTimeout( timeout ).
                setRequestTimeout( timeout ).
                setAcceptAnyCertificate( true ).
                setUserAgent( userAgent ).
                setProxyServer( new ProxyServer( proxy.ip, proxy.port ) ).
                build( )

      AsyncHttpClient client = new AsyncHttpClient( cfg )

      Response response = client.prepareGet( url).execute().get()
1

There are 1 answers

0
Stephane Landelle On

The best way to report issues is to use our bugtracker on Github, and provide the version and the provider (Netty, Grizzly, forget about JDK) you're using.