|
|
|
@ -33,6 +33,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@@ -33,6 +33,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|
|
|
|
import org.springframework.cloud.client.actuator.HasFeatures; |
|
|
|
|
import org.springframework.cloud.client.loadbalancer.AsyncLoadBalancerAutoConfiguration; |
|
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalancedRetryPolicyFactory; |
|
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration; |
|
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient; |
|
|
|
@ -42,6 +43,7 @@ import org.springframework.context.annotation.Bean;
@@ -42,6 +43,7 @@ import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Conditional; |
|
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
|
import org.springframework.retry.support.RetryTemplate; |
|
|
|
|
import org.springframework.web.client.AsyncRestTemplate; |
|
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
|
|
import com.netflix.client.IClient; |
|
|
|
@ -55,10 +57,10 @@ import com.netflix.ribbon.Ribbon;
@@ -55,10 +57,10 @@ import com.netflix.ribbon.Ribbon;
|
|
|
|
|
* @author Dave Syer |
|
|
|
|
*/ |
|
|
|
|
@Configuration |
|
|
|
|
@ConditionalOnClass({ IClient.class, RestTemplate.class }) |
|
|
|
|
@ConditionalOnClass({ IClient.class, RestTemplate.class, AsyncRestTemplate.class}) |
|
|
|
|
@RibbonClients |
|
|
|
|
@AutoConfigureAfter(name = "org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration") |
|
|
|
|
@AutoConfigureBefore(LoadBalancerAutoConfiguration.class) |
|
|
|
|
@AutoConfigureBefore({LoadBalancerAutoConfiguration.class, AsyncLoadBalancerAutoConfiguration.class}) |
|
|
|
|
public class RibbonAutoConfiguration { |
|
|
|
|
|
|
|
|
|
@Autowired(required = false) |
|
|
|
|