Skip to content

Commit f19a01f

Browse files
committed
Make the restTemplateBuilder Lazy
spring-projects/spring-boot#19549
1 parent d2caec5 commit f19a01f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

autoconfigure/src/main/java/io/freefair/spring/okhttp/OkHttpRestTemplateAutoConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.springframework.context.annotation.Bean;
1818
import org.springframework.context.annotation.Conditional;
1919
import org.springframework.context.annotation.Configuration;
20+
import org.springframework.context.annotation.Lazy;
2021
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
2122
import org.springframework.web.client.RestTemplate;
2223

@@ -37,6 +38,7 @@
3738
public class OkHttpRestTemplateAutoConfiguration {
3839

3940
@Bean
41+
@Lazy
4042
@ConditionalOnMissingBean
4143
public RestTemplateBuilder restTemplateBuilder(ObjectProvider<HttpMessageConverters> messageConverters,
4244
ObjectProvider<RestTemplateCustomizer> restTemplateCustomizers,

0 commit comments

Comments
 (0)