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 · 0 comments
Open

symmetry in the way we specify request factories #33933

joshlong opened this issue Nov 21, 2024 · 0 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) 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
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: 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.

3 participants