-
Notifications
You must be signed in to change notification settings - Fork 126
Description
I have a Spring Boot application that uses the library (thanks for all hard work here!) to create non-blocking HTTP clients.
I want to customize the underlying Netty HttpClient used by Feign to change the NameResolverProvider
configuration so that DNS resolution retries with TCP when UDP fails.
This is possible in pure Netty using the following configuration (as suggested in this issue):
HttpClient.create()
.resolver(spec -> spec.retryTcpOnTimeout(true));
This is important in our environment because we sometimes hit DNS resolution failures over UDP, and need the fallback to TCP for reliability.
I haven't found an easy way to achieve it - HttpClient is created in NettyClientHttpConnectorBuilder.buildNettyClientHttpConnector
, and there is no callback or customization logic there. The code of WebReactiveFeign.Builder
allows to set custom HttpClient, but I didn't find a way to do this.