Allow Customizer for HttpClientConnectionManager in HttpClient5FeignConfiguration#1305
Merged
ryanjbaxter merged 5 commits intospring-cloud:mainfrom Dec 18, 2025
Conversation
…gnConfiguration' via new customizer supplied as beans Signed-off-by: Severin Kistler <[email protected]>
Contributor
|
Could you add some tests and documentation for this feature? |
Signed-off-by: Severin Kistler <[email protected]>
fb7b44f to
48be6e1
Compare
ryanjbaxter
reviewed
Dec 17, 2025
…BuilderCustomizer, as it already exists for httpClient5FeignConfiguration.HttpClientBuilderCustomizer a few lines above Signed-off-by: Severin Kistler <[email protected]>
2673c00 to
c23f06e
Compare
Contributor
There was a problem hiding this comment.
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
HttpClientConnectionManagerBuilderCustomizerinterface for programmatic connection manager configuration - Updated
hc5ConnectionManagerbean 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.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Ryan Baxter <[email protected]>
…cloud/openfeign/clientconfig/HttpClient5FeignConfiguration.java Co-authored-by: Copilot <[email protected]> Signed-off-by: Ryan Baxter <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
HttpClientConnectionManagerinHttpClient5FeignConfiguration, as it also exists for theCloseableHttpClientin the same file.In my case, I need to configure the
TlsConfig::handshakeTimeoutas 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>> customizerProviderto thehc5ConnectionManagerbean method.Describe alternatives you've considered
Yes, I know I can override the full
HttpClientConnectionManageras 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 likehttpsSSLConnectionSocketFactoryand 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