@Bean
JdkClientHttpRequestFactory jdkClientHttpRequestFactory() {
return new JdkClientHttpRequestFactory();
}
@Bean
RestClient restClient(
JdkClientHttpRequestFactory jdkClientHttpRequestFactory,
RestClient.Builder builder) {
return builder
.requestFactory(jdkClientHttpRequestFactory)
.build();
}
@Bean
RestTemplate restTemplate(
JdkClientHttpRequestFactory jdkClientHttpRequestFactory,
RestTemplateBuilder builder) {
return builder
.requestFactory(() -> jdkClientHttpRequestFactory)
.build();
}
it would be nice if the ResstClient
also took a Supplier<T>
and the RestTemplate
took a reference.
Comment From: rstoyanchev
We have only RestClient and the RestTempate on our side, and they are consistent with each other.
RestTemplateBuilder is on the Boot side and it has Supplier and Function variants that apply customs settings. That's a different purpose that makes sense for Boot's own needs. we don't aim to be consistent with that.
Is there a specific issue that you've run into or specific use case that is not well served?
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.