Skip to content

Commit e8cbec0

Browse files
committed
Clarify documentation of RestTemplate customization
Closes gh-29394
1 parent d051146 commit e8cbec0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ The following example shows a customizer that configures the use of a proxy for
3434
include::{docs-java}/features/resttemplate/customization/MyRestTemplateCustomizer.java[]
3535
----
3636

37-
Finally, you can also create your own `RestTemplateBuilder` bean.
38-
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`.
39-
The following example exposes a `RestTemplateBuilder` with what Spring Boot would auto-configure, except that custom connect and read timeouts are also specified:
37+
Finally, you can define your own `RestTemplateBuilder` bean.
38+
Doing so will replace the auto-configured builder.
39+
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`.
40+
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:
4041

4142
[source,java,indent=0,subs="verbatim"]
4243
----
4344
include::{docs-java}/features/resttemplate/customization/MyRestTemplateBuilderConfiguration.java[]
4445
----
4546

4647
The most extreme (and rarely used) option is to create your own `RestTemplateBuilder` bean without using a configurer.
47-
Doing so switches off the auto-configuration of a `RestTemplateBuilder` and prevents any `RestTemplateCustomizer` beans from being used.
48+
In addition to replacing the auto-configured builder, this also prevents any `RestTemplateCustomizer` beans from being used.

0 commit comments

Comments
 (0)