spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

Allow Customizer for HttpClientConnectionManager in HttpClient5FeignConfiguration

Open kistlers opened this issue 1 month ago • 1 comments

Is your feature request related to a problem? Please describe. The underlying http client (in my case the apache hc5) is already well-customizable via properties and also via supplying my own beans. I'd like a further middle ground by allowing a list of customzer for HttpClientConnectionManager in HttpClient5FeignConfiguration, as it also exists for the CloseableHttpClient in the same file. In my case, I need to configure the TlsConfig::handshakeTimeout as a result of the new handling in 5.5.1 (see https://issues.apache.org/jira/browse/HTTPCLIENT-2386)

Describe the solution you'd like Allow a list of ObjectProvider<List<HttpClientConnectionManagerBuilderCustomizer>> customizerProvider to the hc5ConnectionManager bean method.

Describe alternatives you've considered Yes, I know I can override the full HttpClientConnectionManager as my own bean, but then I loose the rest of the auto-configuration logic for this bean. I can also not just copy the bean metho and add my own logic, as I would also have to copy private methods like httpsSSLConnectionSocketFactory and my implementation would, over time, surely diverge for the curated defaults that I would like to keep and profit from.

Additional context I am happy to create a PR, unless there is a good reason why this feature does and should not exist.

This PR implements #1304

Edit: copied over issue description from #1304

kistlers avatar Dec 17 '25 13:12 kistlers

Could you add some tests and documentation for this feature?

ryanjbaxter avatar Dec 17 '25 15:12 ryanjbaxter