Skip to content

Commit

Permalink
use default jdk dns resolver (#3877)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Hernán Carle <[email protected]>
Co-authored-by: Pablo Hernán Carle <[email protected]>
  • Loading branch information
pablocarle and Pablo Hernán Carle authored Nov 4, 2024
1 parent adefa8a commit bf1f2ed
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.github.resilience4j.timelimiter.TimeLimiterConfig;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.resolver.DefaultAddressResolverGroup;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.support.AopUtils;
Expand Down Expand Up @@ -345,20 +346,26 @@ public HttpClientFactory gatewayHttpClientFactory(
return new HttpClientFactory(properties, serverProperties, sslConfigurer, customizers) {
@Override
protected HttpClient createInstance() {
return super.createInstance().secure(sslContextSpec -> sslContextSpec.sslContext(sslContext));
return super.createInstance()
.secure(sslContextSpec -> sslContextSpec.sslContext(sslContext))
.resolver(DefaultAddressResolverGroup.INSTANCE);
}
};
}

@Bean
@Primary
public WebClient webClient(HttpClient httpClient) {
return WebClient.builder().clientConnector(new ReactorClientHttpConnector(getHttpClient(httpClient, false))).build();
return WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(getHttpClient(httpClient, false)))
.build();
}

@Bean
public WebClient webClientClientCert(HttpClient httpClient) {
return WebClient.builder().clientConnector(new ReactorClientHttpConnector(getHttpClient(httpClient, true))).build();
return WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(getHttpClient(httpClient, true)))
.build();
}

@Bean
Expand Down

0 comments on commit bf1f2ed

Please sign in to comment.