On Fri, 2016-12-02 at 12:55 -0500, Murat Balkan wrote:
> Hi all,
> 
> When I do httpclient.execute to the url (
> https://mc.yandex.ru/metrika/watch.js) the the execute call hangs more than
> the timeout parameters.  I have socket timeout set to 15 seconds and
> connect timeout set to 15 seconds.
> 
> That site has a DNS round robin and it seems that Httpclient automatically
> tries the next IP address in the resolved address list.
> 
> Is it possible to cancel that behavior?
> 
> Thanks a lot,
> Murat

Murat

You can do so by using a custom DnsResolver

CloseableHttpClient httpclient = HttpClients.custom()
        .setDnsResolver(host ->  new InetAddress[] { 
InetAddress.getByName(host) })
        .build();

Hope this helps

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to