Merge remote-tracking branch 'origin/master' into 2.0.x
This commit is contained in:
36
README.adoc
36
README.adoc
@@ -114,38 +114,14 @@ following command:
|
||||
The generated eclipse projects can be imported by selecting `import existing projects`
|
||||
from the `file` menu.
|
||||
|
||||
|
||||
|
||||
==== Adding Project Lombok Agent
|
||||
|
||||
Spring Cloud uses http://projectlombok.org/features/index.html[Project Lombok]
|
||||
to generate getters and setters etc. Compiling from the command line this
|
||||
shouldn't cause any problems, but in an IDE you need to add an agent
|
||||
to the JVM. Full instructions can be found in the Lombok website. The
|
||||
sign that you need to do this is a lot of compiler errors to do with
|
||||
missing methods and fields, e.g.
|
||||
|
||||
[indent=0]
|
||||
----
|
||||
The method getInitialStatus() is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 120 Java Problem
|
||||
The method getInitialStatus() is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 121 Java Problem
|
||||
The method setNonSecurePort(int) is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 112 Java Problem
|
||||
The type EurekaInstanceConfigBean.IdentifyingDataCenterInfo must implement the inherited abstract method DataCenterInfo.getName() EurekaInstanceConfigBean.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 131 Java Problem
|
||||
The method getId() is undefined for the type ProxyRouteLocator.ProxyRouteSpec PreDecorationFilter.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre line 60 Java Problem
|
||||
The method getLocation() is undefined for the type ProxyRouteLocator.ProxyRouteSpec PreDecorationFilter.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre line 55 Java Problem
|
||||
----
|
||||
|
||||
==== Importing into Intellij
|
||||
Spring Cloud projects use annotation processing, particularly Lombok, which requires configuration
|
||||
or you will encounter compile problems. It also needs a specific version of maven and a profile
|
||||
enabled. Intellij 14.1+ requires some configuration to ensure these are setup properly.
|
||||
Spring Cloud projects need a specific version of Maven and a profile enabled.
|
||||
Intellij 14.1+ requires some configuration to ensure these are setup properly.
|
||||
|
||||
1. Click Preferences, Plugins. *Ensure Lombok is installed*
|
||||
2. Click New, Project from Existing Sources, choose your spring-cloud project directory
|
||||
3. Choose Maven, and select Environment Settings. *Ensure you are using Maven 3.3.3*
|
||||
4. In the next screen, *Select the profile `spring`* click Next until Finish.
|
||||
5. Click Preferences, "Build, Execution, Deployment", Compiler, Annotation Processors. *Click Enable Annotation Processing*
|
||||
6. Click Build, Rebuild Project, and you are ready to go!
|
||||
1. Click New, Project from Existing Sources, choose your spring-cloud project directory
|
||||
2. Choose Maven, and select Environment Settings. *Ensure you are using Maven 3.3.3*
|
||||
3. In the next screen, *Select the profile `spring`* click Next until Finish.
|
||||
4. Click Build, Rebuild Project, and you are ready to go!
|
||||
|
||||
==== Importing into other IDEs
|
||||
Maven is well supported by most Java IDEs. Refer to you vendor documentation.
|
||||
|
||||
16
docs/pom.xml
16
docs/pom.xml
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
@@ -16,14 +16,14 @@
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
<docs.whitelisted.branches>1.0.x,1.1.x,1.2.x,1.3.x,2.0.x</docs.whitelisted.branches>
|
||||
</properties>
|
||||
<build>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
|
||||
@@ -20,8 +20,6 @@ include::intro.adoc[]
|
||||
|
||||
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/building-jdk8.adoc[]
|
||||
|
||||
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/building-lombok.adoc[]
|
||||
|
||||
== Contributing
|
||||
|
||||
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[]
|
||||
|
||||
6
pom.xml
6
pom.xml
@@ -22,7 +22,7 @@
|
||||
<properties>
|
||||
<bintray.package>netflix</bintray.package>
|
||||
<main.basedir>${basedir}</main.basedir>
|
||||
<netty.version>4.0.27.Final</netty.version>
|
||||
<netty.version>4.0.27.Final</netty.version>
|
||||
<jackson.version>2.7.3</jackson.version>
|
||||
<spring-cloud-commons.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-commons.version>
|
||||
<spring-cloud-config.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-config.version>
|
||||
@@ -101,8 +101,8 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-dependencies</artifactId>
|
||||
<version>${spring-cloud-stream.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
|
||||
@@ -186,13 +186,6 @@
|
||||
<artifactId>okhttp</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<!-- Only needed at compile time -->
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.cloud.netflix.feign;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.BeansException;
|
||||
@@ -40,16 +41,13 @@ import feign.Target.HardCodedTarget;
|
||||
import feign.codec.Decoder;
|
||||
import feign.codec.Encoder;
|
||||
import feign.codec.ErrorDecoder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
* @author Venil Noronha
|
||||
* @author Eko Kurniawan Khannedy
|
||||
* @author Gregor Zurowski
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
class FeignClientFactoryBean implements FactoryBean<Object>, InitializingBean,
|
||||
ApplicationContextAware {
|
||||
/***********************************
|
||||
@@ -275,4 +273,99 @@ class FeignClientFactoryBean implements FactoryBean<Object>, InitializingBean,
|
||||
return true;
|
||||
}
|
||||
|
||||
public Class<?> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Class<?> type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public boolean isDecode404() {
|
||||
return decode404;
|
||||
}
|
||||
|
||||
public void setDecode404(boolean decode404) {
|
||||
this.decode404 = decode404;
|
||||
}
|
||||
|
||||
public ApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
public Class<?> getFallback() {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
public void setFallback(Class<?> fallback) {
|
||||
this.fallback = fallback;
|
||||
}
|
||||
|
||||
public Class<?> getFallbackFactory() {
|
||||
return fallbackFactory;
|
||||
}
|
||||
|
||||
public void setFallbackFactory(Class<?> fallbackFactory) {
|
||||
this.fallbackFactory = fallbackFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
FeignClientFactoryBean that = (FeignClientFactoryBean) o;
|
||||
return Objects.equals(applicationContext, that.applicationContext) &&
|
||||
decode404 == that.decode404 &&
|
||||
Objects.equals(fallback, that.fallback) &&
|
||||
Objects.equals(fallbackFactory, that.fallbackFactory) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(path, that.path) &&
|
||||
Objects.equals(type, that.type) &&
|
||||
Objects.equals(url, that.url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(applicationContext, decode404, fallback, fallbackFactory,
|
||||
name, path, type, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("FeignClientFactoryBean{")
|
||||
.append("type=").append(type).append(", ")
|
||||
.append("name='").append(name).append("', ")
|
||||
.append("url='").append(url).append("', ")
|
||||
.append("path='").append(path).append("', ")
|
||||
.append("decode404=").append(decode404).append(", ")
|
||||
.append("applicationContext=").append(applicationContext).append(", ")
|
||||
.append("fallback=").append(fallback).append(", ")
|
||||
.append("fallbackFactory=").append(fallbackFactory)
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import feign.Logger;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.Retryer;
|
||||
import feign.codec.ErrorDecoder;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -18,20 +18,62 @@ package org.springframework.cloud.netflix.feign;
|
||||
|
||||
import org.springframework.cloud.context.named.NamedContextFactory;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
* @author Gregor Zurowski
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
class FeignClientSpecification implements NamedContextFactory.Specification {
|
||||
|
||||
private String name;
|
||||
|
||||
private Class<?>[] configuration;
|
||||
|
||||
public FeignClientSpecification() {}
|
||||
|
||||
public FeignClientSpecification(String name, Class<?>[] configuration) {
|
||||
this.name = name;
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Class<?>[] getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
public void setConfiguration(Class<?>[] configuration) {
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
FeignClientSpecification that = (FeignClientSpecification) o;
|
||||
return Objects.equals(name, that.name) &&
|
||||
Arrays.equals(configuration, that.configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("FeignClientSpecification{")
|
||||
.append("name='").append(name).append("', ")
|
||||
.append("configuration=").append(Arrays.toString(configuration))
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ package org.springframework.cloud.netflix.feign.encoding;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -32,7 +30,6 @@ public abstract class BaseRequestInterceptor implements RequestInterceptor {
|
||||
/**
|
||||
* The encoding properties.
|
||||
*/
|
||||
@Getter(AccessLevel.PROTECTED)
|
||||
private final FeignClientEncodingProperties properties;
|
||||
|
||||
/**
|
||||
@@ -58,4 +55,9 @@ public abstract class BaseRequestInterceptor implements RequestInterceptor {
|
||||
requestTemplate.header(name, values);
|
||||
}
|
||||
}
|
||||
|
||||
protected FeignClientEncodingProperties getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,15 +16,16 @@
|
||||
|
||||
package org.springframework.cloud.netflix.feign.encoding;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* The Feign encoding properties.
|
||||
*
|
||||
* @author Jakub Narloch
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("feign.compression.request")
|
||||
public class FeignClientEncodingProperties {
|
||||
|
||||
@@ -37,4 +38,43 @@ public class FeignClientEncodingProperties {
|
||||
* The minimum threshold content size.
|
||||
*/
|
||||
private int minRequestSize = 2048;
|
||||
|
||||
public String[] getMimeTypes() {
|
||||
return mimeTypes;
|
||||
}
|
||||
|
||||
public void setMimeTypes(String[] mimeTypes) {
|
||||
this.mimeTypes = mimeTypes;
|
||||
}
|
||||
|
||||
public int getMinRequestSize() {
|
||||
return minRequestSize;
|
||||
}
|
||||
|
||||
public void setMinRequestSize(int minRequestSize) {
|
||||
this.minRequestSize = minRequestSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
FeignClientEncodingProperties that = (FeignClientEncodingProperties) o;
|
||||
return Arrays.equals(mimeTypes, that.mimeTypes) &&
|
||||
Objects.equals(minRequestSize, that.minRequestSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mimeTypes, minRequestSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("FeignClientEncodingProperties{")
|
||||
.append("mimeTypes=").append(Arrays.toString(mimeTypes)).append(", ")
|
||||
.append("minRequestSize=").append(minRequestSize)
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@ package org.springframework.cloud.netflix.hystrix;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Venil Noronha
|
||||
* @author Gregor Zurowski
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("hystrix.metrics")
|
||||
public class HystrixMetricsProperties {
|
||||
|
||||
@@ -33,4 +33,41 @@ public class HystrixMetricsProperties {
|
||||
/** Interval between subsequent polling of metrics. Defaults to 2000 ms. */
|
||||
private Integer pollingIntervalMs = 2000;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Integer getPollingIntervalMs() {
|
||||
return pollingIntervalMs;
|
||||
}
|
||||
|
||||
public void setPollingIntervalMs(Integer pollingIntervalMs) {
|
||||
this.pollingIntervalMs = pollingIntervalMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
HystrixMetricsProperties that = (HystrixMetricsProperties) o;
|
||||
return enabled == that.enabled &&
|
||||
Objects.equals(pollingIntervalMs, that.pollingIntervalMs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(enabled, pollingIntervalMs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("HystrixMetricsProperties{")
|
||||
.append("enabled=").append(enabled).append(", ")
|
||||
.append("pollingIntervalMs=").append(pollingIntervalMs)
|
||||
.append("}").toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,20 +18,62 @@ package org.springframework.cloud.netflix.ribbon;
|
||||
|
||||
import org.springframework.cloud.context.named.NamedContextFactory;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RibbonClientSpecification implements NamedContextFactory.Specification {
|
||||
|
||||
private String name;
|
||||
|
||||
private Class<?>[] configuration;
|
||||
|
||||
public RibbonClientSpecification() {
|
||||
}
|
||||
|
||||
public RibbonClientSpecification(String name, Class<?>[] configuration) {
|
||||
this.name = name;
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Class<?>[] getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
public void setConfiguration(Class<?>[] configuration) {
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
RibbonClientSpecification that = (RibbonClientSpecification) o;
|
||||
return Arrays.equals(configuration, that.configuration) &&
|
||||
Objects.equals(name, that.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(configuration, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("RibbonClientSpecification{")
|
||||
.append("name='").append(name).append("', ")
|
||||
.append("configuration=").append(Arrays.toString(configuration))
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,17 +16,47 @@
|
||||
|
||||
package org.springframework.cloud.netflix.ribbon;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Rico Pahlisch
|
||||
* @author Gregor Zurowski
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("ribbon")
|
||||
public class ServerIntrospectorProperties {
|
||||
|
||||
private List<Integer> securePorts = Arrays.asList(443,8443);
|
||||
|
||||
public List<Integer> getSecurePorts() {
|
||||
return securePorts;
|
||||
}
|
||||
|
||||
public void setSecurePorts(List<Integer> securePorts) {
|
||||
this.securePorts = securePorts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ServerIntrospectorProperties that = (ServerIntrospectorProperties) o;
|
||||
return Objects.equals(securePorts, that.securePorts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(securePorts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("ServerIntrospectorProperties{")
|
||||
.append("securePorts=").append(securePorts)
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,9 +18,7 @@ package org.springframework.cloud.netflix.ribbon;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.netflix.client.config.IClientConfig;
|
||||
import com.netflix.config.ConfigurationManager;
|
||||
@@ -34,8 +32,6 @@ import com.netflix.loadbalancer.ZoneAffinityServerListFilter;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ZonePreferenceServerListFilter extends ZoneAffinityServerListFilter<Server> {
|
||||
|
||||
private String zone;
|
||||
@@ -66,4 +62,32 @@ public class ZonePreferenceServerListFilter extends ZoneAffinityServerListFilter
|
||||
return output;
|
||||
}
|
||||
|
||||
public String getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ZonePreferenceServerListFilter that = (ZonePreferenceServerListFilter) o;
|
||||
return Objects.equals(zone, that.zone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(zone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("ZonePreferenceServerListFilter{")
|
||||
.append("zone='").append(zone).append("'")
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,12 +28,9 @@ import org.apache.http.entity.BasicHttpEntity;
|
||||
import org.springframework.cloud.netflix.ribbon.support.ContextAwareRequest;
|
||||
import org.springframework.cloud.netflix.zuul.filters.route.RibbonCommandContext;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author Christian Lohmann
|
||||
*/
|
||||
@Getter
|
||||
public class RibbonApacheHttpRequest extends ContextAwareRequest implements Cloneable {
|
||||
|
||||
public RibbonApacheHttpRequest(RibbonCommandContext context) {
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.List;
|
||||
import org.springframework.cloud.netflix.ribbon.support.ContextAwareRequest;
|
||||
import org.springframework.cloud.netflix.zuul.filters.route.RibbonCommandContext;
|
||||
|
||||
import lombok.Getter;
|
||||
import okhttp3.Headers;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.MediaType;
|
||||
@@ -40,7 +39,6 @@ import okio.Source;
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
@Getter
|
||||
public class OkHttpRibbonRequest extends ContextAwareRequest implements Cloneable {
|
||||
|
||||
public OkHttpRibbonRequest(RibbonCommandContext context) {
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
package org.springframework.cloud.netflix.zuul.filters;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Route {
|
||||
|
||||
public Route(String id, String path, String location, String prefix,
|
||||
@@ -42,7 +40,7 @@ public class Route {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Route(String id, String path, String location, String prefix,
|
||||
Boolean retryable, Set<String> ignoredHeaders, boolean prefixStripped) {
|
||||
this(id, path, location, prefix, retryable, ignoredHeaders);
|
||||
@@ -64,11 +62,115 @@ public class Route {
|
||||
private Set<String> sensitiveHeaders = new LinkedHashSet<>();
|
||||
|
||||
private boolean customSensitiveHeaders;
|
||||
|
||||
|
||||
private boolean prefixStripped = true;
|
||||
|
||||
public boolean isCustomSensitiveHeaders() {
|
||||
return this.customSensitiveHeaders;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFullPath() {
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
public void setFullPath(String fullPath) {
|
||||
this.fullPath = fullPath;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
public Boolean getRetryable() {
|
||||
return retryable;
|
||||
}
|
||||
|
||||
public void setRetryable(Boolean retryable) {
|
||||
this.retryable = retryable;
|
||||
}
|
||||
|
||||
public Set<String> getSensitiveHeaders() {
|
||||
return sensitiveHeaders;
|
||||
}
|
||||
|
||||
public void setSensitiveHeaders(Set<String> sensitiveHeaders) {
|
||||
this.sensitiveHeaders = sensitiveHeaders;
|
||||
}
|
||||
|
||||
public void setCustomSensitiveHeaders(boolean customSensitiveHeaders) {
|
||||
this.customSensitiveHeaders = customSensitiveHeaders;
|
||||
}
|
||||
|
||||
public boolean isPrefixStripped() {
|
||||
return prefixStripped;
|
||||
}
|
||||
|
||||
public void setPrefixStripped(boolean prefixStripped) {
|
||||
this.prefixStripped = prefixStripped;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Route that = (Route) o;
|
||||
return customSensitiveHeaders == that.customSensitiveHeaders &&
|
||||
prefixStripped == that.prefixStripped &&
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(fullPath, that.fullPath) &&
|
||||
Objects.equals(path, that.path) &&
|
||||
Objects.equals(location, that.location) &&
|
||||
Objects.equals(prefix, that.prefix) &&
|
||||
Objects.equals(retryable, that.retryable) &&
|
||||
Objects.equals(sensitiveHeaders, that.sensitiveHeaders);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, fullPath, path, location, prefix, retryable,
|
||||
sensitiveHeaders, customSensitiveHeaders, prefixStripped);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("Route{")
|
||||
.append("id='").append(id).append("', ")
|
||||
.append("fullPath='").append(fullPath).append("', ")
|
||||
.append("path='").append(path).append("', ")
|
||||
.append("location='").append(location).append("', ")
|
||||
.append("prefix='").append(prefix).append("', ")
|
||||
.append("retryable=").append(retryable).append(", ")
|
||||
.append("sensitiveHeaders=").append(sensitiveHeaders).append(", ")
|
||||
.append("customSensitiveHeaders=").append(customSensitiveHeaders).append(", ")
|
||||
.append("prefixStripped=").append(prefixStripped)
|
||||
.append("}").toString();
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.cloud.netflix.zuul.filters.ZuulProperties.ZuulRoute;
|
||||
@@ -65,12 +64,9 @@ public class SimpleRouteLocator implements RouteLocator, Ordered {
|
||||
|
||||
@Override
|
||||
public List<Route> getRoutes() {
|
||||
if (this.routes.get() == null) {
|
||||
this.routes.set(locateRoutes());
|
||||
}
|
||||
List<Route> values = new ArrayList<>();
|
||||
for (String url : this.routes.get().keySet()) {
|
||||
ZuulRoute route = this.routes.get().get(url);
|
||||
for (Entry<String, ZuulRoute> entry : getRoutesMap().entrySet()) {
|
||||
ZuulRoute route = entry.getValue();
|
||||
String path = route.getPath();
|
||||
values.add(getRoute(route, path));
|
||||
}
|
||||
@@ -89,14 +85,20 @@ public class SimpleRouteLocator implements RouteLocator, Ordered {
|
||||
|
||||
}
|
||||
|
||||
protected Map<String, ZuulRoute> getRoutesMap() {
|
||||
if (this.routes.get() == null) {
|
||||
this.routes.set(locateRoutes());
|
||||
}
|
||||
return this.routes.get();
|
||||
}
|
||||
|
||||
protected Route getSimpleMatchingRoute(final String path) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Finding route for path: " + path);
|
||||
}
|
||||
|
||||
if (this.routes.get() == null) {
|
||||
this.routes.set(locateRoutes());
|
||||
}
|
||||
// This is called for the initialization done in getRoutesMap()
|
||||
getRoutesMap();
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("servletPath=" + this.dispatcherServletPath);
|
||||
@@ -116,7 +118,7 @@ public class SimpleRouteLocator implements RouteLocator, Ordered {
|
||||
|
||||
protected ZuulRoute getZuulRoute(String adjustedPath) {
|
||||
if (!matchesIgnoredPatterns(adjustedPath)) {
|
||||
for (Entry<String, ZuulRoute> entry : this.routes.get().entrySet()) {
|
||||
for (Entry<String, ZuulRoute> entry : getRoutesMap().entrySet()) {
|
||||
String pattern = entry.getKey();
|
||||
log.debug("Matching pattern:" + pattern);
|
||||
if (this.pathMatcher.match(pattern, adjustedPath)) {
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
package org.springframework.cloud.netflix.zuul.filters;
|
||||
|
||||
import com.netflix.hystrix.HystrixCommandProperties.ExecutionIsolationStrategy;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -32,6 +29,7 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -42,8 +40,8 @@ import static com.netflix.hystrix.HystrixCommandProperties.ExecutionIsolationStr
|
||||
* @author Dave Syer
|
||||
* @author Mathias Düsterhöft
|
||||
* @author Bilal Alp
|
||||
* @author Gregor Zurowski
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties("zuul")
|
||||
public class ZuulProperties {
|
||||
|
||||
@@ -194,8 +192,6 @@ public class ZuulProperties {
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class ZuulRoute {
|
||||
|
||||
/**
|
||||
@@ -244,6 +240,8 @@ public class ZuulProperties {
|
||||
|
||||
private boolean customSensitiveHeaders = false;
|
||||
|
||||
public ZuulRoute() {}
|
||||
|
||||
public ZuulRoute(String id, String path, String serviceId, String url,
|
||||
boolean stripPrefix, Boolean retryable, Set<String> sensitiveHeaders) {
|
||||
this.id = id;
|
||||
@@ -317,11 +315,97 @@ public class ZuulProperties {
|
||||
return this.customSensitiveHeaders;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getServiceId() {
|
||||
return serviceId;
|
||||
}
|
||||
|
||||
public void setServiceId(String serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public boolean isStripPrefix() {
|
||||
return stripPrefix;
|
||||
}
|
||||
|
||||
public void setStripPrefix(boolean stripPrefix) {
|
||||
this.stripPrefix = stripPrefix;
|
||||
}
|
||||
|
||||
public Boolean getRetryable() {
|
||||
return retryable;
|
||||
}
|
||||
|
||||
public void setRetryable(Boolean retryable) {
|
||||
this.retryable = retryable;
|
||||
}
|
||||
|
||||
public Set<String> getSensitiveHeaders() {
|
||||
return sensitiveHeaders;
|
||||
}
|
||||
|
||||
public void setCustomSensitiveHeaders(boolean customSensitiveHeaders) {
|
||||
this.customSensitiveHeaders = customSensitiveHeaders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ZuulRoute that = (ZuulRoute) o;
|
||||
return customSensitiveHeaders == that.customSensitiveHeaders &&
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(path, that.path) &&
|
||||
Objects.equals(retryable, that.retryable) &&
|
||||
Objects.equals(sensitiveHeaders, that.sensitiveHeaders) &&
|
||||
Objects.equals(serviceId, that.serviceId) &&
|
||||
stripPrefix == that.stripPrefix &&
|
||||
Objects.equals(url, that.url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(customSensitiveHeaders, id, path, retryable,
|
||||
sensitiveHeaders, serviceId, stripPrefix, url);
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return new StringBuilder("ZuulRoute{").append("id='").append(id).append("', ")
|
||||
.append("path='").append(path).append("', ")
|
||||
.append("serviceId='").append(serviceId).append("', ")
|
||||
.append("url='").append(url).append("', ")
|
||||
.append("stripPrefix=").append(stripPrefix).append(", ")
|
||||
.append("retryable=").append(retryable).append(", ")
|
||||
.append("sensitiveHeaders=").append(sensitiveHeaders).append(", ")
|
||||
.append("customSensitiveHeaders=").append(customSensitiveHeaders).append(", ")
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Host {
|
||||
/**
|
||||
* The maximum number of total connections the proxy can hold open to backends.
|
||||
@@ -347,17 +431,141 @@ public class ZuulProperties {
|
||||
* The time unit for timeToLive.
|
||||
*/
|
||||
private TimeUnit timeUnit = TimeUnit.MILLISECONDS;
|
||||
|
||||
public Host() {
|
||||
}
|
||||
|
||||
public Host(int maxTotalConnections, int maxPerRouteConnections,
|
||||
int socketTimeoutMillis, int connectTimeoutMillis, long timeToLive,
|
||||
TimeUnit timeUnit) {
|
||||
this.maxTotalConnections = maxTotalConnections;
|
||||
this.maxPerRouteConnections = maxPerRouteConnections;
|
||||
this.socketTimeoutMillis = socketTimeoutMillis;
|
||||
this.connectTimeoutMillis = connectTimeoutMillis;
|
||||
this.timeToLive = timeToLive;
|
||||
this.timeUnit = timeUnit;
|
||||
}
|
||||
|
||||
public int getMaxTotalConnections() {
|
||||
return maxTotalConnections;
|
||||
}
|
||||
|
||||
public void setMaxTotalConnections(int maxTotalConnections) {
|
||||
this.maxTotalConnections = maxTotalConnections;
|
||||
}
|
||||
|
||||
public int getMaxPerRouteConnections() {
|
||||
return maxPerRouteConnections;
|
||||
}
|
||||
|
||||
public void setMaxPerRouteConnections(int maxPerRouteConnections) {
|
||||
this.maxPerRouteConnections = maxPerRouteConnections;
|
||||
}
|
||||
|
||||
public int getSocketTimeoutMillis() {
|
||||
return socketTimeoutMillis;
|
||||
}
|
||||
|
||||
public void setSocketTimeoutMillis(int socketTimeoutMillis) {
|
||||
this.socketTimeoutMillis = socketTimeoutMillis;
|
||||
}
|
||||
|
||||
public int getConnectTimeoutMillis() {
|
||||
return connectTimeoutMillis;
|
||||
}
|
||||
|
||||
public void setConnectTimeoutMillis(int connectTimeoutMillis) {
|
||||
this.connectTimeoutMillis = connectTimeoutMillis;
|
||||
}
|
||||
|
||||
public long getTimeToLive() {
|
||||
return timeToLive;
|
||||
}
|
||||
|
||||
public void setTimeToLive(long timeToLive) {
|
||||
this.timeToLive = timeToLive;
|
||||
}
|
||||
|
||||
public TimeUnit getTimeUnit() {
|
||||
return timeUnit;
|
||||
}
|
||||
|
||||
public void setTimeUnit(TimeUnit timeUnit) {
|
||||
this.timeUnit = timeUnit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Host host = (Host) o;
|
||||
return maxTotalConnections == host.maxTotalConnections &&
|
||||
maxPerRouteConnections == host.maxPerRouteConnections &&
|
||||
socketTimeoutMillis == host.socketTimeoutMillis &&
|
||||
connectTimeoutMillis == host.connectTimeoutMillis &&
|
||||
timeToLive == host.timeToLive &&
|
||||
timeUnit == host.timeUnit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(maxTotalConnections, maxPerRouteConnections, socketTimeoutMillis, connectTimeoutMillis, timeToLive, timeUnit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("Host{");
|
||||
sb.append("maxTotalConnections=").append(maxTotalConnections);
|
||||
sb.append(", maxPerRouteConnections=").append(maxPerRouteConnections);
|
||||
sb.append(", socketTimeoutMillis=").append(socketTimeoutMillis);
|
||||
sb.append(", connectTimeoutMillis=").append(connectTimeoutMillis);
|
||||
sb.append(", timeToLive=").append(timeToLive);
|
||||
sb.append(", timeUnit=").append(timeUnit);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class HystrixSemaphore {
|
||||
/**
|
||||
* The maximum number of total semaphores for Hystrix.
|
||||
*/
|
||||
private int maxSemaphores = 100;
|
||||
|
||||
|
||||
public HystrixSemaphore() {}
|
||||
|
||||
public HystrixSemaphore(int maxSemaphores) {
|
||||
this.maxSemaphores = maxSemaphores;
|
||||
}
|
||||
|
||||
public int getMaxSemaphores() {
|
||||
return maxSemaphores;
|
||||
}
|
||||
|
||||
public void setMaxSemaphores(int maxSemaphores) {
|
||||
this.maxSemaphores = maxSemaphores;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
HystrixSemaphore that = (HystrixSemaphore) o;
|
||||
return maxSemaphores == that.maxSemaphores;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(maxSemaphores);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("HystrixSemaphore{");
|
||||
sb.append("maxSemaphores=").append(maxSemaphores);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public static class HystrixThreadPool {
|
||||
@@ -404,4 +612,230 @@ public class ZuulProperties {
|
||||
return path;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
public boolean isStripPrefix() {
|
||||
return stripPrefix;
|
||||
}
|
||||
|
||||
public void setStripPrefix(boolean stripPrefix) {
|
||||
this.stripPrefix = stripPrefix;
|
||||
}
|
||||
|
||||
public Boolean getRetryable() {
|
||||
return retryable;
|
||||
}
|
||||
|
||||
public void setRetryable(Boolean retryable) {
|
||||
this.retryable = retryable;
|
||||
}
|
||||
|
||||
public Map<String, ZuulRoute> getRoutes() {
|
||||
return routes;
|
||||
}
|
||||
|
||||
public void setRoutes(Map<String, ZuulRoute> routes) {
|
||||
this.routes = routes;
|
||||
}
|
||||
|
||||
public boolean isAddProxyHeaders() {
|
||||
return addProxyHeaders;
|
||||
}
|
||||
|
||||
public void setAddProxyHeaders(boolean addProxyHeaders) {
|
||||
this.addProxyHeaders = addProxyHeaders;
|
||||
}
|
||||
|
||||
public boolean isAddHostHeader() {
|
||||
return addHostHeader;
|
||||
}
|
||||
|
||||
public void setAddHostHeader(boolean addHostHeader) {
|
||||
this.addHostHeader = addHostHeader;
|
||||
}
|
||||
|
||||
public Set<String> getIgnoredServices() {
|
||||
return ignoredServices;
|
||||
}
|
||||
|
||||
public void setIgnoredServices(Set<String> ignoredServices) {
|
||||
this.ignoredServices = ignoredServices;
|
||||
}
|
||||
|
||||
public Set<String> getIgnoredPatterns() {
|
||||
return ignoredPatterns;
|
||||
}
|
||||
|
||||
public void setIgnoredPatterns(Set<String> ignoredPatterns) {
|
||||
this.ignoredPatterns = ignoredPatterns;
|
||||
}
|
||||
|
||||
public boolean isIgnoreSecurityHeaders() {
|
||||
return ignoreSecurityHeaders;
|
||||
}
|
||||
|
||||
public void setIgnoreSecurityHeaders(boolean ignoreSecurityHeaders) {
|
||||
this.ignoreSecurityHeaders = ignoreSecurityHeaders;
|
||||
}
|
||||
|
||||
public boolean isForceOriginalQueryStringEncoding() {
|
||||
return forceOriginalQueryStringEncoding;
|
||||
}
|
||||
|
||||
public void setForceOriginalQueryStringEncoding(
|
||||
boolean forceOriginalQueryStringEncoding) {
|
||||
this.forceOriginalQueryStringEncoding = forceOriginalQueryStringEncoding;
|
||||
}
|
||||
|
||||
public String getServletPath() {
|
||||
return servletPath;
|
||||
}
|
||||
|
||||
public void setServletPath(String servletPath) {
|
||||
this.servletPath = servletPath;
|
||||
}
|
||||
|
||||
public boolean isIgnoreLocalService() {
|
||||
return ignoreLocalService;
|
||||
}
|
||||
|
||||
public void setIgnoreLocalService(boolean ignoreLocalService) {
|
||||
this.ignoreLocalService = ignoreLocalService;
|
||||
}
|
||||
|
||||
public Host getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(Host host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public boolean isTraceRequestBody() {
|
||||
return traceRequestBody;
|
||||
}
|
||||
|
||||
public void setTraceRequestBody(boolean traceRequestBody) {
|
||||
this.traceRequestBody = traceRequestBody;
|
||||
}
|
||||
|
||||
public boolean isRemoveSemicolonContent() {
|
||||
return removeSemicolonContent;
|
||||
}
|
||||
|
||||
public void setRemoveSemicolonContent(boolean removeSemicolonContent) {
|
||||
this.removeSemicolonContent = removeSemicolonContent;
|
||||
}
|
||||
|
||||
public Set<String> getSensitiveHeaders() {
|
||||
return sensitiveHeaders;
|
||||
}
|
||||
|
||||
public void setSensitiveHeaders(Set<String> sensitiveHeaders) {
|
||||
this.sensitiveHeaders = sensitiveHeaders;
|
||||
}
|
||||
|
||||
public boolean isSslHostnameValidationEnabled() {
|
||||
return sslHostnameValidationEnabled;
|
||||
}
|
||||
|
||||
public void setSslHostnameValidationEnabled(boolean sslHostnameValidationEnabled) {
|
||||
this.sslHostnameValidationEnabled = sslHostnameValidationEnabled;
|
||||
}
|
||||
|
||||
public ExecutionIsolationStrategy getRibbonIsolationStrategy() {
|
||||
return ribbonIsolationStrategy;
|
||||
}
|
||||
|
||||
public void setRibbonIsolationStrategy(
|
||||
ExecutionIsolationStrategy ribbonIsolationStrategy) {
|
||||
this.ribbonIsolationStrategy = ribbonIsolationStrategy;
|
||||
}
|
||||
|
||||
public HystrixSemaphore getSemaphore() {
|
||||
return semaphore;
|
||||
}
|
||||
|
||||
public void setSemaphore(HystrixSemaphore semaphore) {
|
||||
this.semaphore = semaphore;
|
||||
}
|
||||
|
||||
public HystrixThreadPool getThreadPool() {
|
||||
return threadPool;
|
||||
}
|
||||
|
||||
public void setThreadPool(HystrixThreadPool threadPool) {
|
||||
this.threadPool = threadPool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ZuulProperties that = (ZuulProperties) o;
|
||||
return addHostHeader == that.addHostHeader &&
|
||||
addProxyHeaders == that.addProxyHeaders &&
|
||||
forceOriginalQueryStringEncoding == that.forceOriginalQueryStringEncoding &&
|
||||
Objects.equals(host, that.host) &&
|
||||
Objects.equals(ignoredHeaders, that.ignoredHeaders) &&
|
||||
Objects.equals(ignoredPatterns, that.ignoredPatterns) &&
|
||||
Objects.equals(ignoredServices, that.ignoredServices) &&
|
||||
ignoreLocalService == that.ignoreLocalService &&
|
||||
ignoreSecurityHeaders == that.ignoreSecurityHeaders &&
|
||||
Objects.equals(prefix, that.prefix) &&
|
||||
removeSemicolonContent == that.removeSemicolonContent &&
|
||||
Objects.equals(retryable, that.retryable) &&
|
||||
Objects.equals(ribbonIsolationStrategy, that.ribbonIsolationStrategy) &&
|
||||
Objects.equals(routes, that.routes) &&
|
||||
Objects.equals(semaphore, that.semaphore) &&
|
||||
Objects.equals(sensitiveHeaders, that.sensitiveHeaders) &&
|
||||
Objects.equals(servletPath, that.servletPath) &&
|
||||
sslHostnameValidationEnabled == that.sslHostnameValidationEnabled &&
|
||||
stripPrefix == that.stripPrefix &&
|
||||
Objects.equals(threadPool, that.threadPool) &&
|
||||
traceRequestBody == that.traceRequestBody;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(addHostHeader, addProxyHeaders, forceOriginalQueryStringEncoding,
|
||||
host, ignoredHeaders, ignoredPatterns, ignoredServices, ignoreLocalService,
|
||||
ignoreSecurityHeaders, prefix, removeSemicolonContent, retryable,
|
||||
ribbonIsolationStrategy, routes, semaphore, sensitiveHeaders, servletPath,
|
||||
sslHostnameValidationEnabled, stripPrefix, threadPool, traceRequestBody);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("ZuulProperties{")
|
||||
.append("prefix='").append(prefix).append("', ")
|
||||
.append("stripPrefix=").append(stripPrefix).append(", ")
|
||||
.append("retryable=").append(retryable).append(", ")
|
||||
.append("routes=").append(routes).append(", ")
|
||||
.append("addProxyHeaders=").append(addProxyHeaders).append(", ")
|
||||
.append("addHostHeader=").append(addHostHeader).append(", ")
|
||||
.append("ignoredServices=").append(ignoredServices).append(", ")
|
||||
.append("ignoredPatterns=").append(ignoredPatterns).append(", ")
|
||||
.append("ignoredHeaders=").append(ignoredHeaders).append(", ")
|
||||
.append("ignoreSecurityHeaders=").append(ignoreSecurityHeaders).append(", ")
|
||||
.append("forceOriginalQueryStringEncoding=").append(forceOriginalQueryStringEncoding).append(", ")
|
||||
.append("servletPath='").append(servletPath).append("', ")
|
||||
.append("ignoreLocalService=").append(ignoreLocalService).append(", ")
|
||||
.append("host=").append(host).append(", ")
|
||||
.append("traceRequestBody=").append(traceRequestBody).append(", ")
|
||||
.append("removeSemicolonContent=").append(removeSemicolonContent).append(", ")
|
||||
.append("sensitiveHeaders=").append(sensitiveHeaders).append(", ")
|
||||
.append("sslHostnameValidationEnabled=").append(sslHostnameValidationEnabled).append(", ")
|
||||
.append("ribbonIsolationStrategy=").append(ribbonIsolationStrategy).append(", ")
|
||||
.append("semaphore=").append(semaphore).append(", ")
|
||||
.append("threadPool=").append(threadPool).append(", ")
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
@@ -48,9 +49,6 @@ import feign.Client;
|
||||
import feign.Feign;
|
||||
import feign.Target;
|
||||
import feign.httpclient.ApacheHttpClient;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
@@ -171,10 +169,35 @@ public class FeignHttpClientUrlTests {
|
||||
assertEquals("first hello didn't match", new Hello("hello world 1"), hello);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {
|
||||
}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Hello that = (Hello) o;
|
||||
return Objects.equals(message, that.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -43,10 +44,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
@@ -147,11 +144,36 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
|
||||
assertNull("response body was not null", response.getBody());
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {
|
||||
}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Hello that = (Hello) o;
|
||||
return Objects.equals(message, that.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(message);
|
||||
}
|
||||
}
|
||||
|
||||
protected interface TestClient {
|
||||
|
||||
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertTrue;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -42,10 +43,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@@ -89,11 +86,37 @@ public class FeignClientTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {
|
||||
}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Hello that = (Hello) o;
|
||||
|
||||
return Objects.equals(message, that.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return message != null ? message.hashCode() : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -37,6 +37,12 @@ import com.netflix.client.config.IClientConfig;
|
||||
import com.netflix.loadbalancer.ILoadBalancer;
|
||||
import com.netflix.loadbalancer.Server;
|
||||
|
||||
import feign.Client;
|
||||
import feign.Request;
|
||||
import feign.RequestTemplate;
|
||||
import feign.Response;
|
||||
import feign.Request.Options;
|
||||
|
||||
import static com.netflix.client.config.CommonClientConfigKey.ConnectTimeout;
|
||||
import static com.netflix.client.config.CommonClientConfigKey.IsSecure;
|
||||
import static com.netflix.client.config.CommonClientConfigKey.MaxAutoRetries;
|
||||
@@ -52,13 +58,6 @@ import static org.mockito.Matchers.anyBoolean;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import feign.Client;
|
||||
import feign.Request;
|
||||
import feign.Request.Options;
|
||||
import feign.RequestTemplate;
|
||||
import feign.Response;
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
public class FeignLoadBalancerTests {
|
||||
|
||||
@Mock
|
||||
@@ -89,8 +88,7 @@ public class FeignLoadBalancerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void testUriInsecure() {
|
||||
public void testUriInsecure() throws Exception {
|
||||
when(this.config.get(IsSecure)).thenReturn(false);
|
||||
|
||||
this.feignLoadBalancer = new FeignLoadBalancer(this.lb, this.config,
|
||||
@@ -111,8 +109,7 @@ public class FeignLoadBalancerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void testSecureUriFromClientConfig() {
|
||||
public void testSecureUriFromClientConfig() throws Exception {
|
||||
when(this.config.get(IsSecure)).thenReturn(true);
|
||||
this.feignLoadBalancer = new FeignLoadBalancer(this.lb, this.config,
|
||||
this.inspector);
|
||||
@@ -123,8 +120,8 @@ public class FeignLoadBalancerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void testInsecureUriFromInsecureClientConfigToSecureServerIntrospector() {
|
||||
public void testInsecureUriFromInsecureClientConfigToSecureServerIntrospector()
|
||||
throws Exception {
|
||||
when(this.config.get(IsSecure)).thenReturn(false);
|
||||
this.feignLoadBalancer = new FeignLoadBalancer(this.lb, this.config,
|
||||
new ServerIntrospector() {
|
||||
@@ -145,8 +142,7 @@ public class FeignLoadBalancerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void testSecureUriFromClientConfigOverride() {
|
||||
public void testSecureUriFromClientConfigOverride() throws Exception {
|
||||
this.feignLoadBalancer = new FeignLoadBalancer(this.lb, this.config,
|
||||
this.inspector);
|
||||
Server server = Mockito.mock(Server.class);
|
||||
@@ -158,8 +154,7 @@ public class FeignLoadBalancerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void testRibbonRequestURLEncode() {
|
||||
public void testRibbonRequestURLEncode() throws Exception {
|
||||
String url = "http://foo/?name=%7bcookie";//name={cookie
|
||||
Request request = Request.create("GET",url,new HashMap(),null,null);
|
||||
|
||||
|
||||
@@ -42,10 +42,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.netflix.loadbalancer.Server;
|
||||
import com.netflix.loadbalancer.ServerList;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Venil Noronha
|
||||
*/
|
||||
@@ -158,11 +154,22 @@ public class FeignRibbonClientPathTests {
|
||||
hello.getMessage());
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
||||
@@ -18,9 +18,6 @@ package org.springframework.cloud.netflix.feign.ribbon;
|
||||
|
||||
import com.netflix.loadbalancer.Server;
|
||||
import com.netflix.loadbalancer.ServerList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -120,11 +117,23 @@ public class FeignRibbonClientRetryTests {
|
||||
// maybe the assertEquals above is enough because of the bogus servers
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {
|
||||
}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ import static org.hamcrest.Matchers.nullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import feign.RequestTemplate;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
@@ -120,9 +119,16 @@ public class SpringEncoderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
protected static class MyType {
|
||||
private String value;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected interface TestClient {
|
||||
|
||||
@@ -46,9 +46,6 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
import feign.MethodMetadata;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author chadjaros
|
||||
@@ -527,15 +524,20 @@ public class SpringMvcContractTests {
|
||||
TestObject getTest();
|
||||
}
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
|
||||
public class TestObject {
|
||||
|
||||
public String something;
|
||||
public Double number;
|
||||
|
||||
public TestObject() {
|
||||
}
|
||||
|
||||
public TestObject(String something, Double number) {
|
||||
this.something = something;
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
@@ -565,5 +567,13 @@ public class SpringMvcContractTests {
|
||||
result = 31 * result + (this.number != null ? this.number.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("TestObject{")
|
||||
.append("something='").append(something).append("', ")
|
||||
.append("number=").append(number)
|
||||
.append("}").toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,9 +45,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import feign.Logger;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -134,11 +131,22 @@ public class FeignClientNotPrimaryTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -83,9 +84,6 @@ import feign.RequestTemplate;
|
||||
import feign.Target;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import feign.hystrix.SetterFactory;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import rx.Observable;
|
||||
import rx.Single;
|
||||
|
||||
@@ -725,11 +723,36 @@ public class FeignClientTests {
|
||||
assertEquals("hellos didn't match", hellos, getHelloList());
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {
|
||||
}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Hello that = (Hello) o;
|
||||
return Objects.equals(message, that.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(message);
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
||||
@@ -52,9 +52,8 @@ import com.netflix.loadbalancer.Server;
|
||||
import com.netflix.loadbalancer.ServerList;
|
||||
|
||||
import feign.Client;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
@@ -161,18 +160,66 @@ public class FeignHttpClientTests {
|
||||
assertEquals("Users were different", user, new User("John Smith"));
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Hello that = (Hello) o;
|
||||
return Objects.equals(message, that.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(message);
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class User {
|
||||
private String name;
|
||||
|
||||
public User() {}
|
||||
|
||||
public User(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
User that = (User) o;
|
||||
return Objects.equals(name, that.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name);
|
||||
}
|
||||
}
|
||||
|
||||
// Load balancer with fixed server list for "local" pointing to localhost
|
||||
|
||||
@@ -53,9 +53,8 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import feign.Client;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
@@ -115,7 +114,7 @@ public class FeignOkHttpTests {
|
||||
|
||||
@RequestMapping(method = RequestMethod.PATCH, value = "/hellop")
|
||||
public ResponseEntity<Void> patchHello(@RequestBody Hello hello,
|
||||
@RequestHeader("Content-Length") int contentLength) {
|
||||
@RequestHeader("Content-Length") int contentLength) {
|
||||
if (contentLength <= 0) {
|
||||
throw new IllegalArgumentException("Invalid Content-Length "+ contentLength);
|
||||
}
|
||||
@@ -163,18 +162,68 @@ public class FeignOkHttpTests {
|
||||
assertEquals("Users were different", user, new User("John Smith"));
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Hello {
|
||||
private String message;
|
||||
|
||||
public Hello() {
|
||||
}
|
||||
|
||||
public Hello(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Hello that = (Hello) o;
|
||||
return Objects.equals(message, that.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(message);
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class User {
|
||||
private String name;
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public User(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
User that = (User) o;
|
||||
return Objects.equals(name, that.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name);
|
||||
}
|
||||
}
|
||||
|
||||
// Load balancer with fixed server list for "local" pointing to localhost
|
||||
|
||||
@@ -52,8 +52,6 @@ import org.springframework.web.client.RestTemplate;
|
||||
import com.netflix.loadbalancer.Server;
|
||||
import com.netflix.loadbalancer.ServerList;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
@@ -128,8 +126,7 @@ public class RibbonClientHttpRequestFactoryTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void requestWithHeaderWorks() {
|
||||
public void requestWithHeaderWorks() throws Exception {
|
||||
RequestEntity<Void> entity = RequestEntity.get(new URI("http://simple/header"))
|
||||
.header("X-Param", "world").build();
|
||||
ResponseEntity<String> response = this.restTemplate.exchange(entity,
|
||||
|
||||
@@ -38,8 +38,6 @@ import com.netflix.loadbalancer.LoadBalancerStats;
|
||||
import com.netflix.loadbalancer.Server;
|
||||
import com.netflix.loadbalancer.ServerStats;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -88,7 +86,7 @@ public class RibbonLoadBalancerClientTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void reconstructURI() {
|
||||
public void reconstructURI() throws Exception {
|
||||
testReconstructURI("http");
|
||||
}
|
||||
|
||||
@@ -97,8 +95,7 @@ public class RibbonLoadBalancerClientTests {
|
||||
testReconstructURI("https");
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
private void testReconstructURI(String scheme) {
|
||||
private void testReconstructURI(String scheme) throws Exception {
|
||||
RibbonServer server = getRibbonServer();
|
||||
RibbonLoadBalancerClient client = getRibbonLoadBalancerClient(server);
|
||||
ServiceInstance serviceInstance = client.choose(server.getServiceId());
|
||||
@@ -134,8 +131,7 @@ public class RibbonLoadBalancerClientTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void testReconstructUriWithSecureClientConfig() {
|
||||
public void testReconstructUriWithSecureClientConfig() throws Exception {
|
||||
RibbonServer server = getRibbonServer();
|
||||
IClientConfig config = mock(IClientConfig.class);
|
||||
when(config.get(CommonClientConfigKey.IsSecure)).thenReturn(true);
|
||||
@@ -151,19 +147,17 @@ public class RibbonLoadBalancerClientTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void testReconstructSecureUriWithoutScheme() {
|
||||
public void testReconstructSecureUriWithoutScheme() throws Exception {
|
||||
testReconstructSchemelessUriWithoutClientConfig(getSecureRibbonServer(), "https");
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
public void testReconstructUnsecureSchemelessUri() {
|
||||
public void testReconstructUnsecureSchemelessUri() throws Exception {
|
||||
testReconstructSchemelessUriWithoutClientConfig(getRibbonServer(), "http");
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public void testReconstructSchemelessUriWithoutClientConfig(RibbonServer server, String expectedScheme) {
|
||||
public void testReconstructSchemelessUriWithoutClientConfig(RibbonServer server, String expectedScheme)
|
||||
throws Exception {
|
||||
IClientConfig config = mock(IClientConfig.class);
|
||||
when(config.get(CommonClientConfigKey.IsSecure)).thenReturn(null);
|
||||
when(clientFactory.getClientConfig(server.getServiceId())).thenReturn(config);
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.netflix.zuul.filters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import org.junit.Test;
|
||||
import org.springframework.cloud.netflix.zuul.filters.ZuulProperties.ZuulRoute;
|
||||
|
||||
/**
|
||||
* @author Tom Cawley
|
||||
*/
|
||||
public class SimpleRouteLocatorTests {
|
||||
private ZuulProperties zuul = new ZuulProperties();
|
||||
|
||||
public SimpleRouteLocatorTests() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getRoutesDefaultRouteAcceptor() {
|
||||
RouteLocator locator = new SimpleRouteLocator("/", this.zuul);
|
||||
this.zuul.getRoutes().clear();
|
||||
this.zuul.getRoutes().put("foo", new ZuulRoute("/foo/**", "foo"));
|
||||
|
||||
assertThat(locator.getRoutes(), hasItem(createRoute("foo", "/**", "/foo")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getRoutesFilterRouteAcceptor() {
|
||||
RouteLocator locator = new FilteringRouteLocator("/", this.zuul);
|
||||
this.zuul.getRoutes().clear();
|
||||
this.zuul.getRoutes().put("foo", new ZuulRoute("/foo/**", "foo"));
|
||||
this.zuul.getRoutes().put("bar", new ZuulRoute("/bar/**", "bar"));
|
||||
|
||||
final List<Route> routes = locator.getRoutes();
|
||||
assertThat(routes, hasItem(createRoute("bar", "/**", "/bar")));
|
||||
assertThat(routes, hasSize(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getMatchingRouteFilterRouteAcceptor() {
|
||||
RouteLocator locator = new FilteringRouteLocator("/", this.zuul);
|
||||
this.zuul.getRoutes().clear();
|
||||
this.zuul.getRoutes().put("foo", new ZuulRoute("/foo/**", "foo"));
|
||||
this.zuul.getRoutes().put("bar", new ZuulRoute("/bar/**", "bar"));
|
||||
|
||||
assertThat(locator.getMatchingRoute("/foo/1"), nullValue());
|
||||
assertThat(locator.getMatchingRoute("/bar/1"), is(createRoute("bar", "/1", "/bar")));
|
||||
}
|
||||
|
||||
private Route createRoute(String id, String path, String prefix) {
|
||||
return new Route(id, path, id, prefix, false, null);
|
||||
}
|
||||
|
||||
private static class FilteringRouteLocator extends SimpleRouteLocator {
|
||||
public FilteringRouteLocator(String servletPath, ZuulProperties properties) {
|
||||
super(servletPath, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Route> getRoutes() {
|
||||
List<Route> values = new ArrayList<>();
|
||||
|
||||
for (Entry<String, ZuulRoute> entry : getRoutesMap().entrySet()) {
|
||||
ZuulRoute route = entry.getValue();
|
||||
if (acceptRoute(route)) {
|
||||
String path = route.getPath();
|
||||
values.add(getRoute(route, path));
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
private boolean acceptRoute(ZuulRoute route) {
|
||||
return route != null && !(route.getId().equals("foo"));
|
||||
}
|
||||
|
||||
protected Route getRoute(ZuulRoute route, String path) {
|
||||
if (acceptRoute(route)) {
|
||||
return super.getRoute(route, path);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// For testing, expose as public so we can call getRoutesMap() directly.
|
||||
@Override
|
||||
public Map<String, ZuulRoute> getRoutesMap() {
|
||||
return super.getRoutesMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,10 +43,6 @@ import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.MockitoAnnotations.initMocks;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
* @author Dave Syer
|
||||
@@ -69,15 +65,45 @@ public class DiscoveryClientRouteLocatorTests {
|
||||
|
||||
private ZuulProperties properties = new ZuulProperties();
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class RegexMapper {
|
||||
private boolean enabled = false;
|
||||
|
||||
private String servicePattern = "(?<name>.*)-(?<version>v.*$)";
|
||||
|
||||
private String routePattern = "${version}/${name}";
|
||||
|
||||
public RegexMapper() {
|
||||
}
|
||||
|
||||
public RegexMapper(boolean enabled, String servicePattern, String routePattern) {
|
||||
this.enabled = enabled;
|
||||
this.servicePattern = servicePattern;
|
||||
this.routePattern = routePattern;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getServicePattern() {
|
||||
return servicePattern;
|
||||
}
|
||||
|
||||
public void setServicePattern(String servicePattern) {
|
||||
this.servicePattern = servicePattern;
|
||||
}
|
||||
|
||||
public String getRoutePattern() {
|
||||
return routePattern;
|
||||
}
|
||||
|
||||
public void setRoutePattern(String routePattern) {
|
||||
this.routePattern = routePattern;
|
||||
}
|
||||
}
|
||||
|
||||
private RegexMapper regexMapper = new RegexMapper();
|
||||
|
||||
@@ -85,8 +85,6 @@ import com.netflix.loadbalancer.Server;
|
||||
import com.netflix.loadbalancer.ServerList;
|
||||
import com.netflix.niws.client.http.RestClient;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = RestClientRibbonCommandIntegrationTests.TestConfig.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = {
|
||||
"zuul.routes.other: /test/**=http://localhost:7777/local",
|
||||
@@ -369,7 +367,6 @@ public class RestClientRibbonCommandIntegrationTests extends ZuulProxyTestBase {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
@SneakyThrows
|
||||
public RestClientRibbonCommand create(RibbonCommandContext context) {
|
||||
String uri = context.getUri();
|
||||
if (uri.startsWith("/throwexception/")) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<ribbon.version>2.2.2</ribbon.version>
|
||||
<servo.version>0.10.1</servo.version>
|
||||
<zuul.version>1.3.0</zuul.version>
|
||||
<rxjava.version>1.1.10</rxjava.version>
|
||||
<rxjava.version>1.2.0</rxjava.version>
|
||||
<java.version>1.7</java.version>
|
||||
<turbine.version>1.0.0</turbine.version>
|
||||
<eureka-jersey.version>1.19.1</eureka-jersey.version>
|
||||
|
||||
@@ -16,23 +16,24 @@
|
||||
|
||||
package org.springframework.cloud.netflix.eureka.server;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.core.env.PropertyResolver;
|
||||
|
||||
import com.netflix.eureka.EurekaServerConfig;
|
||||
import com.netflix.eureka.aws.AwsBindingStrategy;
|
||||
import org.springframework.core.style.ToStringCreator;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
* @author Gregor Zurowski
|
||||
*/
|
||||
@ConfigurationProperties(EurekaServerConfigBean.PREFIX)
|
||||
public class EurekaServerConfigBean implements EurekaServerConfig {
|
||||
@@ -919,19 +920,203 @@ public class EurekaServerConfigBean implements EurekaServerConfig {
|
||||
this.minAvailableInstancesForPeerReplication = minAvailableInstancesForPeerReplication;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return EqualsBuilder.reflectionEquals(this, o);
|
||||
@Override public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
EurekaServerConfigBean that = (EurekaServerConfigBean) o;
|
||||
return aSGCacheExpiryTimeoutMs == that.aSGCacheExpiryTimeoutMs &&
|
||||
aSGQueryTimeoutMs == that.aSGQueryTimeoutMs &&
|
||||
aSGUpdateIntervalMs == that.aSGUpdateIntervalMs &&
|
||||
Objects.equals(aWSAccessId, that.aWSAccessId) &&
|
||||
Objects.equals(aWSSecretKey, that.aWSSecretKey) &&
|
||||
batchReplication == that.batchReplication &&
|
||||
bindingStrategy == that.bindingStrategy &&
|
||||
deltaRetentionTimerIntervalInMs == that.deltaRetentionTimerIntervalInMs &&
|
||||
disableDelta == that.disableDelta &&
|
||||
disableDeltaForRemoteRegions == that.disableDeltaForRemoteRegions &&
|
||||
disableTransparentFallbackToOtherRegion == that.disableTransparentFallbackToOtherRegion &&
|
||||
eIPBindingRetryIntervalMs == that.eIPBindingRetryIntervalMs &&
|
||||
eIPBindingRetryIntervalMsWhenUnbound == that.eIPBindingRetryIntervalMsWhenUnbound &&
|
||||
eIPBindRebindRetries == that.eIPBindRebindRetries &&
|
||||
enableReplicatedRequestCompression == that.enableReplicatedRequestCompression &&
|
||||
enableSelfPreservation == that.enableSelfPreservation &&
|
||||
evictionIntervalTimerInMs == that.evictionIntervalTimerInMs &&
|
||||
gZipContentFromRemoteRegion == that.gZipContentFromRemoteRegion &&
|
||||
Objects.equals(jsonCodecName, that.jsonCodecName) &&
|
||||
Objects.equals(listAutoScalingGroupsRoleName, that.listAutoScalingGroupsRoleName) &&
|
||||
logIdentityHeaders == that.logIdentityHeaders &&
|
||||
maxElementsInPeerReplicationPool == that.maxElementsInPeerReplicationPool &&
|
||||
maxElementsInStatusReplicationPool == that.maxElementsInStatusReplicationPool &&
|
||||
maxIdleThreadAgeInMinutesForPeerReplication == that.maxIdleThreadAgeInMinutesForPeerReplication &&
|
||||
maxIdleThreadInMinutesAgeForStatusReplication == that.maxIdleThreadInMinutesAgeForStatusReplication &&
|
||||
maxThreadsForPeerReplication == that.maxThreadsForPeerReplication &&
|
||||
maxThreadsForStatusReplication == that.maxThreadsForStatusReplication &&
|
||||
maxTimeForReplication == that.maxTimeForReplication &&
|
||||
minAvailableInstancesForPeerReplication == that.minAvailableInstancesForPeerReplication &&
|
||||
minThreadsForPeerReplication == that.minThreadsForPeerReplication &&
|
||||
minThreadsForStatusReplication == that.minThreadsForStatusReplication &&
|
||||
numberOfReplicationRetries == that.numberOfReplicationRetries &&
|
||||
peerEurekaNodesUpdateIntervalMs == that.peerEurekaNodesUpdateIntervalMs &&
|
||||
peerEurekaStatusRefreshTimeIntervalMs == that.peerEurekaStatusRefreshTimeIntervalMs &&
|
||||
peerNodeConnectionIdleTimeoutSeconds == that.peerNodeConnectionIdleTimeoutSeconds &&
|
||||
peerNodeConnectTimeoutMs == that.peerNodeConnectTimeoutMs &&
|
||||
peerNodeReadTimeoutMs == that.peerNodeReadTimeoutMs &&
|
||||
peerNodeTotalConnections == that.peerNodeTotalConnections &&
|
||||
peerNodeTotalConnectionsPerHost == that.peerNodeTotalConnectionsPerHost &&
|
||||
primeAwsReplicaConnections == that.primeAwsReplicaConnections &&
|
||||
Objects.equals(propertyResolver, that.propertyResolver) &&
|
||||
rateLimiterBurstSize == that.rateLimiterBurstSize &&
|
||||
rateLimiterEnabled == that.rateLimiterEnabled &&
|
||||
rateLimiterFullFetchAverageRate == that.rateLimiterFullFetchAverageRate &&
|
||||
Objects.equals(rateLimiterPrivilegedClients, that.rateLimiterPrivilegedClients) &&
|
||||
rateLimiterRegistryFetchAverageRate == that.rateLimiterRegistryFetchAverageRate &&
|
||||
rateLimiterThrottleStandardClients == that.rateLimiterThrottleStandardClients &&
|
||||
registrySyncRetries == that.registrySyncRetries &&
|
||||
registrySyncRetryWaitMs == that.registrySyncRetryWaitMs &&
|
||||
Objects.equals(remoteRegionAppWhitelist, that.remoteRegionAppWhitelist) &&
|
||||
remoteRegionConnectionIdleTimeoutSeconds == that.remoteRegionConnectionIdleTimeoutSeconds &&
|
||||
remoteRegionConnectTimeoutMs == that.remoteRegionConnectTimeoutMs &&
|
||||
remoteRegionFetchThreadPoolSize == that.remoteRegionFetchThreadPoolSize &&
|
||||
remoteRegionReadTimeoutMs == that.remoteRegionReadTimeoutMs &&
|
||||
remoteRegionRegistryFetchInterval == that.remoteRegionRegistryFetchInterval &&
|
||||
remoteRegionTotalConnections == that.remoteRegionTotalConnections &&
|
||||
remoteRegionTotalConnectionsPerHost == that.remoteRegionTotalConnectionsPerHost &&
|
||||
Objects.equals(remoteRegionTrustStore, that.remoteRegionTrustStore) &&
|
||||
Objects.equals(remoteRegionTrustStorePassword, that.remoteRegionTrustStorePassword) &&
|
||||
Arrays.equals(remoteRegionUrls, that.remoteRegionUrls) &&
|
||||
Objects.equals(remoteRegionUrlsWithName, that.remoteRegionUrlsWithName) &&
|
||||
Double.compare(that.renewalPercentThreshold, renewalPercentThreshold) == 0 &&
|
||||
renewalThresholdUpdateIntervalMs == that.renewalThresholdUpdateIntervalMs &&
|
||||
responseCacheAutoExpirationInSeconds == that.responseCacheAutoExpirationInSeconds &&
|
||||
responseCacheUpdateIntervalMs == that.responseCacheUpdateIntervalMs &&
|
||||
retentionTimeInMSInDeltaQueue == that.retentionTimeInMSInDeltaQueue &&
|
||||
route53BindingRetryIntervalMs == that.route53BindingRetryIntervalMs &&
|
||||
route53BindRebindRetries == that.route53BindRebindRetries &&
|
||||
route53DomainTTL == that.route53DomainTTL &&
|
||||
syncWhenTimestampDiffers == that.syncWhenTimestampDiffers &&
|
||||
useReadOnlyResponseCache == that.useReadOnlyResponseCache &&
|
||||
waitTimeInMsWhenSyncEmpty == that.waitTimeInMsWhenSyncEmpty &&
|
||||
Objects.equals(xmlCodecName, that.xmlCodecName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return HashCodeBuilder.reflectionHashCode(this);
|
||||
return Objects.hash(aSGCacheExpiryTimeoutMs, aSGQueryTimeoutMs,
|
||||
aSGUpdateIntervalMs, aWSAccessId, aWSSecretKey, batchReplication,
|
||||
bindingStrategy, deltaRetentionTimerIntervalInMs, disableDelta,
|
||||
disableDeltaForRemoteRegions,
|
||||
disableTransparentFallbackToOtherRegion, eIPBindRebindRetries,
|
||||
eIPBindingRetryIntervalMs, eIPBindingRetryIntervalMsWhenUnbound,
|
||||
enableReplicatedRequestCompression, enableSelfPreservation,
|
||||
evictionIntervalTimerInMs, gZipContentFromRemoteRegion,
|
||||
jsonCodecName, listAutoScalingGroupsRoleName, logIdentityHeaders,
|
||||
maxElementsInPeerReplicationPool, maxElementsInStatusReplicationPool,
|
||||
maxIdleThreadAgeInMinutesForPeerReplication,
|
||||
maxIdleThreadInMinutesAgeForStatusReplication,
|
||||
maxThreadsForPeerReplication, maxThreadsForStatusReplication,
|
||||
maxTimeForReplication, minAvailableInstancesForPeerReplication,
|
||||
minThreadsForPeerReplication, minThreadsForStatusReplication,
|
||||
numberOfReplicationRetries, peerEurekaNodesUpdateIntervalMs,
|
||||
peerEurekaStatusRefreshTimeIntervalMs, peerNodeConnectTimeoutMs,
|
||||
peerNodeConnectionIdleTimeoutSeconds, peerNodeReadTimeoutMs,
|
||||
peerNodeTotalConnections, peerNodeTotalConnectionsPerHost,
|
||||
primeAwsReplicaConnections, propertyResolver, rateLimiterBurstSize,
|
||||
rateLimiterEnabled, rateLimiterFullFetchAverageRate,
|
||||
rateLimiterPrivilegedClients, rateLimiterRegistryFetchAverageRate,
|
||||
rateLimiterThrottleStandardClients, registrySyncRetries,
|
||||
registrySyncRetryWaitMs, remoteRegionAppWhitelist,
|
||||
remoteRegionConnectTimeoutMs,
|
||||
remoteRegionConnectionIdleTimeoutSeconds,
|
||||
remoteRegionFetchThreadPoolSize, remoteRegionReadTimeoutMs,
|
||||
remoteRegionRegistryFetchInterval, remoteRegionTotalConnections,
|
||||
remoteRegionTotalConnectionsPerHost, remoteRegionTrustStore,
|
||||
remoteRegionTrustStorePassword, remoteRegionUrls,
|
||||
remoteRegionUrlsWithName, renewalPercentThreshold,
|
||||
renewalThresholdUpdateIntervalMs,
|
||||
responseCacheAutoExpirationInSeconds,
|
||||
responseCacheUpdateIntervalMs, retentionTimeInMSInDeltaQueue,
|
||||
route53BindRebindRetries, route53BindingRetryIntervalMs,
|
||||
route53DomainTTL, syncWhenTimestampDiffers,
|
||||
useReadOnlyResponseCache, waitTimeInMsWhenSyncEmpty, xmlCodecName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
return new ToStringCreator(this)
|
||||
.append("aSGCacheExpiryTimeoutMs", this.aSGCacheExpiryTimeoutMs)
|
||||
.append("aSGQueryTimeoutMs", this.aSGQueryTimeoutMs)
|
||||
.append("aSGUpdateIntervalMs", this.aSGUpdateIntervalMs)
|
||||
.append("aWSAccessId", this.aWSAccessId)
|
||||
.append("aWSSecretKey", this.aWSSecretKey)
|
||||
.append("batchReplication", this.batchReplication)
|
||||
.append("bindingStrategy", this.bindingStrategy)
|
||||
.append("deltaRetentionTimerIntervalInMs", this.deltaRetentionTimerIntervalInMs)
|
||||
.append("disableDelta", this.disableDelta)
|
||||
.append("disableDeltaForRemoteRegions", this.disableDeltaForRemoteRegions)
|
||||
.append("disableTransparentFallbackToOtherRegion", this.disableTransparentFallbackToOtherRegion)
|
||||
.append("eIPBindRebindRetries", this.eIPBindRebindRetries)
|
||||
.append("eIPBindingRetryIntervalMs", this.eIPBindingRetryIntervalMs)
|
||||
.append("eIPBindingRetryIntervalMsWhenUnbound", this.eIPBindingRetryIntervalMsWhenUnbound)
|
||||
.append("enableReplicatedRequestCompression", this.enableReplicatedRequestCompression)
|
||||
.append("enableSelfPreservation", this.enableSelfPreservation)
|
||||
.append("evictionIntervalTimerInMs", this.evictionIntervalTimerInMs)
|
||||
.append("gZipContentFromRemoteRegion", this.gZipContentFromRemoteRegion)
|
||||
.append("jsonCodecName", this.jsonCodecName)
|
||||
.append("listAutoScalingGroupsRoleName", this.listAutoScalingGroupsRoleName)
|
||||
.append("logIdentityHeaders", this.logIdentityHeaders)
|
||||
.append("maxElementsInPeerReplicationPool", this.maxElementsInPeerReplicationPool)
|
||||
.append("maxElementsInStatusReplicationPool", this.maxElementsInStatusReplicationPool)
|
||||
.append("maxIdleThreadAgeInMinutesForPeerReplication", this.maxIdleThreadAgeInMinutesForPeerReplication)
|
||||
.append("maxIdleThreadInMinutesAgeForStatusReplication", this.maxIdleThreadInMinutesAgeForStatusReplication)
|
||||
.append("maxThreadsForPeerReplication", this.maxThreadsForPeerReplication)
|
||||
.append("maxThreadsForStatusReplication", this.maxThreadsForStatusReplication)
|
||||
.append("maxTimeForReplication", this.maxTimeForReplication)
|
||||
.append("minAvailableInstancesForPeerReplication", this.minAvailableInstancesForPeerReplication)
|
||||
.append("minThreadsForPeerReplication", this.minThreadsForPeerReplication)
|
||||
.append("minThreadsForStatusReplication", this.minThreadsForStatusReplication)
|
||||
.append("numberOfReplicationRetries", this.numberOfReplicationRetries)
|
||||
.append("peerEurekaNodesUpdateIntervalMs", this.peerEurekaNodesUpdateIntervalMs)
|
||||
.append("peerEurekaStatusRefreshTimeIntervalMs", this.peerEurekaStatusRefreshTimeIntervalMs)
|
||||
.append("peerNodeConnectTimeoutMs", this.peerNodeConnectTimeoutMs)
|
||||
.append("peerNodeConnectionIdleTimeoutSeconds", this.peerNodeConnectionIdleTimeoutSeconds)
|
||||
.append("peerNodeReadTimeoutMs", this.peerNodeReadTimeoutMs)
|
||||
.append("peerNodeTotalConnections", this.peerNodeTotalConnections)
|
||||
.append("peerNodeTotalConnectionsPerHost", this.peerNodeTotalConnectionsPerHost)
|
||||
.append("primeAwsReplicaConnections", this.primeAwsReplicaConnections)
|
||||
.append("propertyResolver", this.propertyResolver)
|
||||
.append("rateLimiterBurstSize", this.rateLimiterBurstSize)
|
||||
.append("rateLimiterEnabled", this.rateLimiterEnabled)
|
||||
.append("rateLimiterFullFetchAverageRate", this.rateLimiterFullFetchAverageRate)
|
||||
.append("rateLimiterPrivilegedClients", this.rateLimiterPrivilegedClients)
|
||||
.append("rateLimiterRegistryFetchAverageRate", this.rateLimiterRegistryFetchAverageRate)
|
||||
.append("rateLimiterThrottleStandardClients", this.rateLimiterThrottleStandardClients)
|
||||
.append("registrySyncRetries", this.registrySyncRetries)
|
||||
.append("registrySyncRetryWaitMs", this.registrySyncRetryWaitMs)
|
||||
.append("remoteRegionAppWhitelist", this.remoteRegionAppWhitelist)
|
||||
.append("remoteRegionConnectTimeoutMs", this.remoteRegionConnectTimeoutMs)
|
||||
.append("remoteRegionConnectionIdleTimeoutSeconds", this.remoteRegionConnectionIdleTimeoutSeconds)
|
||||
.append("remoteRegionFetchThreadPoolSize", this.remoteRegionFetchThreadPoolSize)
|
||||
.append("remoteRegionReadTimeoutMs", this.remoteRegionReadTimeoutMs)
|
||||
.append("remoteRegionRegistryFetchInterval", this.remoteRegionRegistryFetchInterval)
|
||||
.append("remoteRegionTotalConnections", this.remoteRegionTotalConnections)
|
||||
.append("remoteRegionTotalConnectionsPerHost", this.remoteRegionTotalConnectionsPerHost)
|
||||
.append("remoteRegionTrustStore", this.remoteRegionTrustStore)
|
||||
.append("remoteRegionTrustStorePassword", this.remoteRegionTrustStorePassword)
|
||||
.append("remoteRegionUrls", this.remoteRegionUrls)
|
||||
.append("remoteRegionUrlsWithName", this.remoteRegionUrlsWithName)
|
||||
.append("renewalPercentThreshold", this.renewalPercentThreshold)
|
||||
.append("renewalThresholdUpdateIntervalMs", this.renewalThresholdUpdateIntervalMs)
|
||||
.append("responseCacheAutoExpirationInSeconds", this.responseCacheAutoExpirationInSeconds)
|
||||
.append("responseCacheUpdateIntervalMs", this.responseCacheUpdateIntervalMs)
|
||||
.append("retentionTimeInMSInDeltaQueue", this.retentionTimeInMSInDeltaQueue)
|
||||
.append("route53BindRebindRetries", this.route53BindRebindRetries)
|
||||
.append("route53BindingRetryIntervalMs", this.route53BindingRetryIntervalMs)
|
||||
.append("route53DomainTTL", this.route53DomainTTL)
|
||||
.append("syncWhenTimestampDiffers", this.syncWhenTimestampDiffers)
|
||||
.append("useReadOnlyResponseCache", this.useReadOnlyResponseCache)
|
||||
.append("waitTimeInMsWhenSyncEmpty", this.waitTimeInMsWhenSyncEmpty)
|
||||
.append("xmlCodecName", this.xmlCodecName)
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
|
||||
<name>Spring Cloud Starter Netflix Eureka Server</name>
|
||||
<description>Spring Cloud Starter Netflix Eureka Server</description>
|
||||
<url>https://projects.spring.io/spring-cloud</url>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-netflix-turbine-amqp</artifactId>
|
||||
<name>Spring Cloud Starter Netflix Turbine AMQP</name>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-netflix-turbine-amqp</artifactId>
|
||||
<name>Spring Cloud Starter Netflix Turbine AMQP</name>
|
||||
<description>Spring Cloud Starter Netflix Turbine AMQP (deprecated, please use spring-cloud-starter-netflix-turbine-stream)</description>
|
||||
<url>https://projects.spring.io/spring-cloud</url>
|
||||
<organization>
|
||||
|
||||
Reference in New Issue
Block a user