Skip to content

symmetry in the way we specify request factories #33933

Open
@joshlong

Description

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

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: feedback-reminderWe've sent a reminder that we need additional information before we can continuestatus: waiting-for-feedbackWe need additional information before we can continuestatus: waiting-for-triageAn issue we've not yet triaged or decided on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions