Skip to content

Commit

Permalink
Make the restTemplateBuilder Lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgrefer committed Mar 3, 2020
1 parent d2caec5 commit f19a01f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

Expand All @@ -37,6 +38,7 @@
public class OkHttpRestTemplateAutoConfiguration {

@Bean
@Lazy
@ConditionalOnMissingBean
public RestTemplateBuilder restTemplateBuilder(ObjectProvider<HttpMessageConverters> messageConverters,
ObjectProvider<RestTemplateCustomizer> restTemplateCustomizers,
Expand Down

0 comments on commit f19a01f

Please sign in to comment.