Skip to content

Conversation

@kistlers
Copy link
Contributor

@kistlers kistlers commented Dec 17, 2025

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

…gnConfiguration' via new customizer supplied as beans

Signed-off-by: Severin Kistler <kistlerseverin@gmail.com>
@ryanjbaxter
Copy link
Contributor

Could you add some tests and documentation for this feature?

@ryanjbaxter ryanjbaxter added enhancement New feature or request and removed waiting-for-triage labels Dec 17, 2025
Signed-off-by: Severin Kistler <kistlerseverin@gmail.com>
@kistlers kistlers force-pushed the feature/gh-1304-customize-hc5-connection-manager branch from fb7b44f to 48be6e1 Compare December 17, 2025 15:30
…BuilderCustomizer, as it already exists for httpClient5FeignConfiguration.HttpClientBuilderCustomizer a few lines above

Signed-off-by: Severin Kistler <kistlerseverin@gmail.com>
@kistlers kistlers force-pushed the feature/gh-1304-customize-hc5-connection-manager branch from 2673c00 to c23f06e Compare December 18, 2025 09:46
@kistlers kistlers requested a review from ryanjbaxter December 18, 2025 09:46
@ryanjbaxter ryanjbaxter requested review from Copilot and removed request for ryanjbaxter December 18, 2025 11:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for customizing the HttpClientConnectionManager in HttpClient5FeignConfiguration through a new HttpClientConnectionManagerBuilderCustomizer interface, mirroring the existing customization pattern for CloseableHttpClient. This addresses the need to configure connection manager settings like TLS handshake timeouts without overriding the entire bean configuration.

Key Changes:

  • Introduced HttpClientConnectionManagerBuilderCustomizer interface for programmatic connection manager configuration
  • Updated hc5ConnectionManager bean to accept and apply customizers
  • Added documentation and test coverage for the new customization mechanism

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
HttpClient5FeignConfiguration.java Added new HttpClientConnectionManagerBuilderCustomizer interface and updated hc5ConnectionManager to apply customizers
FeignHttpClient5ConfigurationTests.java Added test coverage for the new connection manager customizer functionality
spring-cloud-openfeign.adoc Updated documentation with examples showing both HTTP client and connection manager customization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ryanjbaxter and others added 2 commits December 18, 2025 09:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ryan Baxter <ryan.baxter@broadcom.com>
…cloud/openfeign/clientconfig/HttpClient5FeignConfiguration.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ryan Baxter <ryan.baxter@broadcom.com>
@github-project-automation github-project-automation bot moved this to Todo in 2025.1.1 Dec 18, 2025
@ryanjbaxter ryanjbaxter added this to the 5.0.1 milestone Dec 18, 2025
@ryanjbaxter ryanjbaxter merged commit ce2342d into spring-cloud:main Dec 18, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Todo to Done in 2025.1.1 Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants