Commit dfaad78d by Spencer Gibb

update versions of netflix libs

parent e51f0cae
...@@ -121,6 +121,12 @@ ...@@ -121,6 +121,12 @@
<groupId>com.netflix.feign</groupId> <groupId>com.netflix.feign</groupId>
<artifactId>feign-ribbon</artifactId> <artifactId>feign-ribbon</artifactId>
<version>${feign.version}</version> <version>${feign.version}</version>
<exclusions>
<exclusion>
<groupId>com.netflix.ribbon</groupId>
<artifactId>ribbon-loadbalancer</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!--<dependency> <!--<dependency>
<groupId>com.netflix.feign</groupId> <groupId>com.netflix.feign</groupId>
...@@ -249,14 +255,14 @@ ...@@ -249,14 +255,14 @@
</dependencyManagement> </dependencyManagement>
<properties> <properties>
<archaius.version>0.6.0</archaius.version> <archaius.version>0.6.3</archaius.version>
<eureka.version>1.1.135</eureka.version> <eureka.version>1.1.145</eureka.version>
<feign.version>6.1.2</feign.version> <feign.version>6.1.3</feign.version>
<hystrix.version>1.4.0-RC5</hystrix.version> <hystrix.version>1.4.0-RC5</hystrix.version>
<ribbon.version>2.0-RC9</ribbon.version> <ribbon.version>2.0-RC13</ribbon.version>
<turbine.version>0.4</turbine.version> <turbine.version>1.0.0</turbine.version>
<zuul.version>1.0.24</zuul.version> <zuul.version>1.0.28</zuul.version>
<netflix.rxjava.version>0.20.6</netflix.rxjava.version> <netflix.rxjava.version>0.20.7</netflix.rxjava.version>
</properties> </properties>
</project> </project>
...@@ -55,6 +55,10 @@ public class EurekaClientConfigBean implements EurekaClientConfig { ...@@ -55,6 +55,10 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
private String proxyHost; private String proxyHost;
private String proxyUserName;
private String proxyPassword;
private int eurekaServerReadTimeoutSeconds = 8; private int eurekaServerReadTimeoutSeconds = 8;
private int eurekaServerConnectTimeoutSeconds = 5; private int eurekaServerConnectTimeoutSeconds = 5;
...@@ -79,8 +83,12 @@ public class EurekaClientConfigBean implements EurekaClientConfig { ...@@ -79,8 +83,12 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
private int heartbeatExecutorThreadPoolSize = 2; private int heartbeatExecutorThreadPoolSize = 2;
private int heartbeatExecutorExponentialBackOffBound = 10;
private int cacheRefreshExecutorThreadPoolSize = 2; private int cacheRefreshExecutorThreadPoolSize = 2;
private int cacheRefreshExecutorExponentialBackOffBound = 10;
private Map<String,String> serviceUrl = new HashMap<String, String>(); private Map<String,String> serviceUrl = new HashMap<String, String>();
{ {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package org.springframework.cloud.netflix.eureka; package org.springframework.cloud.netflix.eureka;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -181,4 +182,22 @@ public class EurekaServerConfigBean implements EurekaServerConfig { ...@@ -181,4 +182,22 @@ public class EurekaServerConfigBean implements EurekaServerConfig {
return batchReplication; return batchReplication;
} }
private boolean logIdentityHeaders = true;
@Override
public boolean shouldLogIdentityHeaders() {
return logIdentityHeaders;
}
private boolean rateLimiterEnabled = false;
private boolean rateLimiterThrottleStandardClients = false;
private Set<String> rateLimiterPrivilegedClients = Collections.emptySet();
private int rateLimiterBurstSize = 10;
private int rateLimiterRegistryFetchAverageRate = 500;
private int rateLimiterFullFetchAverageRate = 100;
} }
...@@ -24,7 +24,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient { ...@@ -24,7 +24,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
private SpringClientFactory clientFactory; private SpringClientFactory clientFactory;
private Map<String, ILoadBalancer> balancers = new HashMap<>(); private Map<String, ILoadBalancer> balancers = new HashMap<>();
private Map<String, LoadBalancerContext> contexts = new HashMap<>(); private Map<String, RibbonLoadBalancerContext> contexts = new HashMap<>();
public RibbonLoadBalancerClient(RibbonClientPreprocessor ribbonClientPreprocessor, SpringClientFactory clientFactory, List<BaseLoadBalancer> balancers) { public RibbonLoadBalancerClient(RibbonClientPreprocessor ribbonClientPreprocessor, SpringClientFactory clientFactory, List<BaseLoadBalancer> balancers) {
this.ribbonClientPreprocessor = ribbonClientPreprocessor; this.ribbonClientPreprocessor = ribbonClientPreprocessor;
...@@ -37,7 +37,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient { ...@@ -37,7 +37,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
@Override @Override
public URI reconstructURI(ServiceInstance instance, URI original) { public URI reconstructURI(ServiceInstance instance, URI original) {
String serviceId = instance.getServiceId(); String serviceId = instance.getServiceId();
LoadBalancerContext context = getOrCreateLoadBalancerContext(serviceId, getLoadBalancer(serviceId)); RibbonLoadBalancerContext context = getOrCreateLoadBalancerContext(serviceId, getLoadBalancer(serviceId));
Server server = new Server(instance.getHost(), instance.getPort()); Server server = new Server(instance.getHost(), instance.getPort());
return context.reconstructURIWithServer(server, original); return context.reconstructURIWithServer(server, original);
} }
...@@ -50,7 +50,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient { ...@@ -50,7 +50,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
@Override @Override
public <T> T execute(String serviceId, LoadBalancerRequest<T> request) { public <T> T execute(String serviceId, LoadBalancerRequest<T> request) {
ILoadBalancer loadBalancer = getLoadBalancer(serviceId); ILoadBalancer loadBalancer = getLoadBalancer(serviceId);
LoadBalancerContext context = getOrCreateLoadBalancerContext(serviceId, loadBalancer); RibbonLoadBalancerContext context = getOrCreateLoadBalancerContext(serviceId, loadBalancer);
Server server = getServer(serviceId, loadBalancer); Server server = getServer(serviceId, loadBalancer);
RibbonServer ribbonServer = new RibbonServer(serviceId, server); RibbonServer ribbonServer = new RibbonServer(serviceId, server);
...@@ -70,16 +70,16 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient { ...@@ -70,16 +70,16 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
return null; return null;
} }
private void recordStats(LoadBalancerContext context, Stopwatch tracer, ServerStats serverStats, Object entity, Throwable exception) { private void recordStats(RibbonLoadBalancerContext context, Stopwatch tracer, ServerStats serverStats, Object entity, Throwable exception) {
tracer.stop(); tracer.stop();
long duration = tracer.getDuration(TimeUnit.MILLISECONDS); long duration = tracer.getDuration(TimeUnit.MILLISECONDS);
context.noteRequestCompletion(serverStats, entity, exception, duration, null/*errorHandler*/); context.noteRequestCompletion(serverStats, entity, exception, duration, null/*errorHandler*/);
} }
protected LoadBalancerContext getOrCreateLoadBalancerContext(String serviceId, ILoadBalancer loadBalancer) { protected RibbonLoadBalancerContext getOrCreateLoadBalancerContext(String serviceId, ILoadBalancer loadBalancer) {
LoadBalancerContext context = contexts.get(serviceId); RibbonLoadBalancerContext context = contexts.get(serviceId);
if (context == null) { if (context == null) {
context = new LoadBalancerContext(loadBalancer); context = new RibbonLoadBalancerContext(loadBalancer);
contexts.put(serviceId, context); contexts.put(serviceId, context);
} }
return context; return context;
......
package org.springframework.cloud.netflix.ribbon;
import com.netflix.client.RetryHandler;
import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.LoadBalancerContext;
import com.netflix.loadbalancer.ServerStats;
import com.netflix.servo.monitor.Timer;
/**
* @author Spencer Gibb
*/
public class RibbonLoadBalancerContext extends LoadBalancerContext {
public RibbonLoadBalancerContext(ILoadBalancer lb) {
super(lb);
}
public RibbonLoadBalancerContext(ILoadBalancer lb, IClientConfig clientConfig) {
super(lb, clientConfig);
}
public RibbonLoadBalancerContext(ILoadBalancer lb, IClientConfig clientConfig, RetryHandler handler) {
super(lb, clientConfig, handler);
}
@Override
public void noteOpenConnection(ServerStats serverStats) {
super.noteOpenConnection(serverStats);
}
@Override
public Timer getExecuteTracer() {
return super.getExecuteTracer();
}
@Override
public void noteRequestCompletion(ServerStats stats, Object response, Throwable e, long responseTime) {
super.noteRequestCompletion(stats, response, e, responseTime);
}
@Override
public void noteRequestCompletion(ServerStats stats, Object response, Throwable e, long responseTime, RetryHandler errorHandler) {
super.noteRequestCompletion(stats, response, e, responseTime, errorHandler);
}
}
...@@ -79,6 +79,19 @@ public class SpringAggregatorFactory implements ClusterMonitorFactory<AggDataFro ...@@ -79,6 +79,19 @@ public class SpringAggregatorFactory implements ClusterMonitorFactory<AggDataFro
return clusters; return clusters;
} }
/**
* shutdown all configured cluster monitors
*/
@Override
public void shutdownClusterMonitors() {
for(String clusterName : getClusterNames()) {
ClusterMonitor<AggDataFromCluster> clusterMonitor = (ClusterMonitor<AggDataFromCluster>) AggregateClusterMonitor.findOrRegisterAggregateMonitor(clusterName);
clusterMonitor.stopMonitor();
clusterMonitor.getDispatcher().stopDispatcher();
}
}
private TurbineDataHandler<AggDataFromCluster> StaticListener = new TurbineDataHandler<AggDataFromCluster>() { private TurbineDataHandler<AggDataFromCluster> StaticListener = new TurbineDataHandler<AggDataFromCluster>() {
@Override @Override
......
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