RestTemplateBuilder has mentioned method RestClient.Builder does not have. If I want to configure connect or read timeout I need to replace underlying ClientHttpRequestFactory

The idea of Spring Boot and customizers is that Spring Boot provides defaults and customizers allows isolated modification. Replacing whole object to modify one attribute does not match the idea

Comment From: wilkinsona

You could use a RestClientCustomizer bean to customize the timeouts on the request factory:

@Bean
RestClientCustomizer restClientCustomizer() {
    return (builder) -> {
        builder.requestFactory(ClientHttpRequestFactories
            .get(ClientHttpRequestFactorySettings.DEFAULTS.withConnectTimeout(Duration.ofSeconds(30))
                .withReadTimeout(Duration.ofSeconds(30))));
    };
}

Beyond this, RestClient.Builder is part of Spring Framework so we are not in a position to change its API in Spring Boot.