Skip to content
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

symmetry in the way we specify request factories #33933

Open
joshlong opened this issue Nov 21, 2024 · 2 comments
Open

symmetry in the way we specify request factories #33933

joshlong opened this issue Nov 21, 2024 · 2 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@joshlong
Copy link
Member

    @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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 21, 2024
@bclozel bclozel added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Nov 21, 2024
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Feb 4, 2025

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?

@rstoyanchev rstoyanchev added the status: waiting-for-feedback We need additional information before we can continue label Feb 4, 2025
@spring-projects-issues
Copy link
Collaborator

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.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants