diff --git a/README.md b/README.md index e289648..ea9ba8f 100644 --- a/README.md +++ b/README.md @@ -609,13 +609,31 @@ public class HttpDegradeFallbackFactory implements FallbackFactory${lombok.version} provided - - org.springframework.cloud - spring-cloud-commons - 2.0.4.RELEASE - provided - - - * - * - - - org.springframework.boot diff --git a/src/main/java/com/github/lianjiatech/retrofit/spring/boot/core/SpringCloudServiceInstanceChooser.java b/src/main/java/com/github/lianjiatech/retrofit/spring/boot/core/SpringCloudServiceInstanceChooser.java deleted file mode 100644 index 167fb91..0000000 --- a/src/main/java/com/github/lianjiatech/retrofit/spring/boot/core/SpringCloudServiceInstanceChooser.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.github.lianjiatech.retrofit.spring.boot.core; - -import org.springframework.cloud.client.ServiceInstance; -import org.springframework.cloud.client.loadbalancer.LoadBalancerClient; -import org.springframework.util.Assert; - -import java.net.URI; - -/** - * @author 陈添明 - */ -public class SpringCloudServiceInstanceChooser implements ServiceInstanceChooser { - - private final LoadBalancerClient loadBalancerClient; - - public SpringCloudServiceInstanceChooser(LoadBalancerClient loadBalancerClient) { - this.loadBalancerClient = loadBalancerClient; - } - - /** - * Chooses a ServiceInstance URI from the LoadBalancer for the specified service. - * - * @param serviceId The service ID to look up the LoadBalancer. - * @return Return the uri of ServiceInstance - */ - @Override - public URI choose(String serviceId) { - ServiceInstance serviceInstance = loadBalancerClient.choose(serviceId); - Assert.notNull(serviceInstance, "can not found service instance! serviceId=" + serviceId); - return serviceInstance.getUri(); - } -}