Commit befcada4 by Spencer Gibb

formatting

parent d29839ea
...@@ -51,7 +51,6 @@ public class RibbonAutoConfiguration { ...@@ -51,7 +51,6 @@ public class RibbonAutoConfiguration {
@Autowired(required = false) @Autowired(required = false)
private List<RibbonClientSpecification> configurations = new ArrayList<>(); private List<RibbonClientSpecification> configurations = new ArrayList<>();
@Bean @Bean
public SpringClientFactory springClientFactory() { public SpringClientFactory springClientFactory() {
SpringClientFactory factory = new SpringClientFactory(); SpringClientFactory factory = new SpringClientFactory();
...@@ -65,30 +64,31 @@ public class RibbonAutoConfiguration { ...@@ -65,30 +64,31 @@ public class RibbonAutoConfiguration {
return new RibbonLoadBalancerClient(springClientFactory()); return new RibbonLoadBalancerClient(springClientFactory());
} }
@Configuration @Configuration
@ConditionalOnClass(HttpRequest.class) @ConditionalOnClass(HttpRequest.class)
protected static class RibbonClientConfig { protected static class RibbonClientConfig {
@Autowired @Autowired
private SpringClientFactory springClientFactory; private SpringClientFactory springClientFactory;
@Autowired @Autowired
private LoadBalancerClient loadBalancerClient; private LoadBalancerClient loadBalancerClient;
@Bean @Bean
public RestTemplateCustomizer restTemplateCustomizer() { public RestTemplateCustomizer restTemplateCustomizer() {
return new RestTemplateCustomizer() { return new RestTemplateCustomizer() {
@Override @Override
public void customize(RestTemplate restTemplate) { public void customize(RestTemplate restTemplate) {
restTemplate.setRequestFactory(ribbonClientHttpRequestFactory()); restTemplate.setRequestFactory(ribbonClientHttpRequestFactory());
} }
}; };
} }
@Bean @Bean
public RibbonClientHttpRequestFactory ribbonClientHttpRequestFactory() { public RibbonClientHttpRequestFactory ribbonClientHttpRequestFactory() {
return new RibbonClientHttpRequestFactory(springClientFactory, loadBalancerClient); return new RibbonClientHttpRequestFactory(springClientFactory,
} loadBalancerClient);
} }
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment