Netty Http 客户端 - 配置 DNSResolution 超时
Netty Http Client - Configure DNSResolution timeout
我在使用 WebClient 时遇到此错误。根据我的配置,这是预期的。但是如何通过netty http客户端配置dns名称解析的超时时间呢?
Caused by: io.netty.resolver.dns.DnsNameResolverTimeoutException: [/127.0.0.11:53] query via UDP timed out after 5000 milliseconds (no stack trace available)
默认情况下,DNS 查询超时为 5 秒 (DEFAULT_QUERY_TIMEOUT),但如果需要,您可以自定义下划线 Netty HttpClient
HttpClient httpClient = HttpClient.create()
.resolver(spec -> spec.queryTimeout(Duration.ofSeconds(10)));
WebClient client = WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(httpClient))
.build();
我在使用 WebClient 时遇到此错误。根据我的配置,这是预期的。但是如何通过netty http客户端配置dns名称解析的超时时间呢?
Caused by: io.netty.resolver.dns.DnsNameResolverTimeoutException: [/127.0.0.11:53] query via UDP timed out after 5000 milliseconds (no stack trace available)
默认情况下,DNS 查询超时为 5 秒 (DEFAULT_QUERY_TIMEOUT),但如果需要,您可以自定义下划线 Netty HttpClient
HttpClient httpClient = HttpClient.create()
.resolver(spec -> spec.queryTimeout(Duration.ofSeconds(10)));
WebClient client = WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(httpClient))
.build();