Commit a7c6c88f by Spencer Gibb

renamed RibbonLoadBalancerClient to FeignRibbonClient

parent 3d7cc707
...@@ -6,7 +6,7 @@ import feign.Feign; ...@@ -6,7 +6,7 @@ import feign.Feign;
import feign.Logger; import feign.Logger;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cloud.netflix.feign.ribbon.RibbonLoadBalancerClient; import org.springframework.cloud.netflix.feign.ribbon.FeignRibbonClient;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.cloud.netflix.archaius.ArchaiusAutoConfiguration; import org.springframework.cloud.netflix.archaius.ArchaiusAutoConfiguration;
...@@ -15,6 +15,7 @@ import com.netflix.loadbalancer.ILoadBalancer; ...@@ -15,6 +15,7 @@ import com.netflix.loadbalancer.ILoadBalancer;
/** /**
* @author Spencer Gibb * @author Spencer Gibb
* @author Julien Roy
*/ */
@Configuration @Configuration
@ConditionalOnClass(Feign.class) @ConditionalOnClass(Feign.class)
...@@ -43,5 +44,5 @@ public class FeignAutoConfiguration { ...@@ -43,5 +44,5 @@ public class FeignAutoConfiguration {
@Bean @Bean
@ConditionalOnClass(ILoadBalancer.class) @ConditionalOnClass(ILoadBalancer.class)
public Client feignRibbonClient() { return new RibbonLoadBalancerClient(); } public Client feignRibbonClient() { return new FeignRibbonClient(); }
} }
...@@ -41,8 +41,6 @@ public class FeignConfigurer { ...@@ -41,8 +41,6 @@ public class FeignConfigurer {
Client ribbonClient; Client ribbonClient;
protected Feign.Builder feign() { protected Feign.Builder feign() {
//ConfigurationManager.getConfigInstance().setProperty("exampleBackend.ribbon.listOfServers", "localhost:7080");
//exampleBackend.ribbon.NIWSServerListClassName=my.package.MyServerList
return Feign.builder() return Feign.builder()
.logger(logger) .logger(logger)
.encoder(encoder) .encoder(encoder)
......
...@@ -7,9 +7,6 @@ import javax.net.ssl.HostnameVerifier; ...@@ -7,9 +7,6 @@ import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.SSLSocketFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.ribbon.RibbonClientPreprocessor;
import com.google.common.base.Throwables; import com.google.common.base.Throwables;
import com.netflix.client.ClientException; import com.netflix.client.ClientException;
import com.netflix.client.ClientFactory; import com.netflix.client.ClientFactory;
...@@ -22,9 +19,10 @@ import feign.Request; ...@@ -22,9 +19,10 @@ import feign.Request;
import feign.Response; import feign.Response;
/** /**
* @author: Julien Roy * @author Julien Roy
* @author Spencer Gibb
*/ */
public class RibbonLoadBalancerClient implements Client { public class FeignRibbonClient implements Client {
private Client defaultClient = new Default( private Client defaultClient = new Default(
new Lazy<SSLSocketFactory>() { new Lazy<SSLSocketFactory>() {
...@@ -62,4 +60,8 @@ public class RibbonLoadBalancerClient implements Client { ...@@ -62,4 +60,8 @@ public class RibbonLoadBalancerClient implements Client {
ILoadBalancer lb = ClientFactory.getNamedLoadBalancer(clientName); ILoadBalancer lb = ClientFactory.getNamedLoadBalancer(clientName);
return new RibbonLoadBalancer(defaultClient, lb, config); return new RibbonLoadBalancer(defaultClient, lb, config);
} }
public void setDefaultClient(Client defaultClient) {
this.defaultClient = defaultClient;
}
} }
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