79785469

Date: 2025-10-08 12:59:05
Score: 0.5
Natty:
Report link

Possible solutions

Configure maxIdleTime on the ConnectionProvider

ConnectionProvider connectionProvider = ConnectionProvider.builder("custom")
    .maxIdleTime(Duration.ofSeconds(60))
    .build();

HttpClient httpClient = HttpClient.create(connectionProvider);

WebClient webClient = WebClient.builder()
    .clientConnector(new ReactorClientHttpConnector(httpClient))
    .build();

Set Timeouts on the HttpClient

HttpClient httpClient = HttpClient.create()
    .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000)
    .responseTimeout(Duration.ofSeconds(60));

Disable TCP Keep-Alive

HttpClient httpClient = HttpClient.create()
    .option(ChannelOption.SO_KEEPALIVE, false);

You also might have more useful logs by changing log level for Netty

logging:
  level:
    reactor.netty.http.client: DEBUG
Reasons:
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Max