-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a mechanism for easily configuring global client HTTP request factory settings #36266
Comments
We think that the ability to easily specify the |
Hi @wilkinsona, possible first-timer contribution here! Do you mind I pick this issue up? |
Thanks for the offer, @be0x74a, but we're not exactly sure what we want to do here just yet. I probably should have labelled the issue as pending design work when I opened it. I've done that now. |
Ah alright, thanks for letting me know @wilkinsona! Will keep an eye on it, for when it gets decided |
I did something similar to this in the new Spring Cloud Gateway MVC Server
|
I stumbled upon this issue because I was wondering why |
Add a new `ClientHttpRequestFactoryBuilder` interface to support the creation of `ClientHttpRequestFactory` instances. The new code will ultimately replace the existing `ClientHttpRequestFactories` class. The `ClientHttpRequestFactoryBuilder` is a functional interface with additional static factory methods for the various supported `ClientHttpRequestFactory` types. Each type has it's own builder which should allow us to support additional customization in the future. Unlike `ClientHttpRequestFactories`, the builder aligns with Spring Framework defaults and will detect the `JdkClientHttpRequestFactory` in preference of `SimpleClientHttpRequestFactory`. This commit also relocates `ClientHttpRequestFactorySettings` to bring it into the new `http.client` package. See gh-36266
Refactor the internals of `RestTemplateBuilder` so that the new `ClientHttpRequestFactoryBuilder` is used to create `ClientHttpRequestFactory` instance. See gh-36266
Deprecate `ClientHttpRequestFactories` and refactor its internals to delegate to the new `ClientHttpRequestFactoryBuilder` interface. Closes gh-36266
We use
ClientHttpRequestFactorySettings
when creatingRestTemplateBuilder
,RestClient.Builder
, and indirectlyTestRestTemplate
. It would be useful to have a mechanism for changing the settings for each of these three usages in a single place, perhaps by using configuration properties. In addition to those settings, it should also be possible specify the type ofClientHttpRequestFactory
to use. This would be useful when you want to override the class path-based auto-detection.The text was updated successfully, but these errors were encountered: