gh-298 Add a per-client request factory customizer#300
Open
SlobodianBohdan wants to merge 6 commits into
Open
Conversation
added 6 commits
June 25, 2026 08:11
…lient http request factory
…d document the JDK http properties
…t for the Jetty client
…nstead of creating one
…spring.threads.virtual.enabled
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.
Part of #298. Stacked on top of #299 — please merge #299 first; this PR will then be
rebased onto master to leave only the customizer commit. (Until then it shows #299's
commits too.)
Adds a per-client request factory customizer, for configuration that is not exposed as
properties.
New
HttpClientCustomizer<B>functional interface — a single generic interface whereBis the implementation-specific builder of the configured
client-http-request-factory-impl:java.net.http.HttpClient.Builder(jdk),org.apache.hc.client5.http.impl.classic.HttpClientBuilder(http-components) or
org.eclipse.jetty.client.HttpClient(jetty).New per-client
request-factory-customizer-beanproperty naming the bean to apply.The bean is resolved from the
ApplicationContextand applied to the underlying clientbuilder just before the request factory is built, in each implementation's helper.
Example:
com:
c4-soft:
springaddons:
rest:
client:
machin-client:
http:
request-factory-customizer-bean: machinHttpClientCustomizer
@bean
HttpClientCustomizer<HttpClient.Builder> machinHttpClientCustomizer() {
return builder -> builder.version(HttpClient.Version.HTTP_1_1);
}
README updated with a dedicated section; tests included.