From e8cbec08368fb516aea8e9d6c14f3592de1073cd Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 14 Jan 2022 15:51:08 +0000 Subject: [PATCH] Clarify documentation of RestTemplate customization Closes gh-29394 --- .../src/docs/asciidoc/features/resttemplate.adoc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc index 84e8378b0b6b..630206d75be6 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc @@ -34,9 +34,10 @@ The following example shows a customizer that configures the use of a proxy for include::{docs-java}/features/resttemplate/customization/MyRestTemplateCustomizer.java[] ---- -Finally, you can also create your own `RestTemplateBuilder` bean. -To prevent switching off the auto-configuration of a `RestTemplateBuilder` and prevent any `RestTemplateCustomizer` beans from being used, make sure to configure your custom instance with a `RestTemplateBuilderConfigurer`. -The following example exposes a `RestTemplateBuilder` with what Spring Boot would auto-configure, except that custom connect and read timeouts are also specified: +Finally, you can define your own `RestTemplateBuilder` bean. +Doing so will replace the auto-configured builder. +If you want any `RestTemplateCustomizer` beans to be applied to your custom builder, as the auto-configuration would have done, configure it using a `RestTemplateBuilderConfigurer`. +The following example exposes a `RestTemplateBuilder` that matches what Spring Boot's auto-configuration would have done, except that custom connect and read timeouts are also specified: [source,java,indent=0,subs="verbatim"] ---- @@ -44,4 +45,4 @@ include::{docs-java}/features/resttemplate/customization/MyRestTemplateBuilderCo ---- The most extreme (and rarely used) option is to create your own `RestTemplateBuilder` bean without using a configurer. -Doing so switches off the auto-configuration of a `RestTemplateBuilder` and prevents any `RestTemplateCustomizer` beans from being used. +In addition to replacing the auto-configured builder, this also prevents any `RestTemplateCustomizer` beans from being used.