Upgrade to eureka 1.6.0

fixes gh-1345
parent ea4e5d76
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<description>Spring Cloud Netflix Dependencies</description> <description>Spring Cloud Netflix Dependencies</description>
<properties> <properties>
<archaius.version>0.7.4</archaius.version> <archaius.version>0.7.4</archaius.version>
<eureka.version>1.4.11</eureka.version> <eureka.version>1.6.0</eureka.version>
<feign.version>9.3.1</feign.version> <feign.version>9.3.1</feign.version>
<hystrix.version>1.5.6</hystrix.version> <hystrix.version>1.5.6</hystrix.version>
<ribbon.version>2.2.0</ribbon.version> <ribbon.version>2.2.0</ribbon.version>
......
...@@ -26,6 +26,7 @@ import org.springframework.boot.test.util.EnvironmentTestUtils; ...@@ -26,6 +26,7 @@ import org.springframework.boot.test.util.EnvironmentTestUtils;
import org.springframework.cloud.commons.util.UtilAutoConfiguration; import org.springframework.cloud.commons.util.UtilAutoConfiguration;
import org.springframework.cloud.config.client.ConfigClientProperties; import org.springframework.cloud.config.client.ConfigClientProperties;
import org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration; import org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration;
import org.springframework.cloud.netflix.eureka.CloudEurekaClient;
import org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration; import org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -99,7 +100,7 @@ public class DiscoveryClientConfigServiceAutoConfigurationTests { ...@@ -99,7 +100,7 @@ public class DiscoveryClientConfigServiceAutoConfigurationTests {
@Bean @Bean
public EurekaClient eurekaClient(ApplicationInfoManager manager) { public EurekaClient eurekaClient(ApplicationInfoManager manager) {
InstanceInfo info = manager.getInfo(); InstanceInfo info = manager.getInfo();
EurekaClient client = Mockito.mock(EurekaClient.class); EurekaClient client = Mockito.mock(CloudEurekaClient.class);
given(client.getInstancesByVipAddress(DEFAULT_CONFIG_SERVER, false)) given(client.getInstancesByVipAddress(DEFAULT_CONFIG_SERVER, false))
.willReturn(Arrays.asList(info)); .willReturn(Arrays.asList(info));
return client; return client;
......
...@@ -188,6 +188,8 @@ public class EurekaServerConfigBean implements EurekaServerConfig, EurekaConstan ...@@ -188,6 +188,8 @@ public class EurekaServerConfigBean implements EurekaServerConfig, EurekaConstan
private AwsBindingStrategy bindingStrategy = AwsBindingStrategy.EIP; private AwsBindingStrategy bindingStrategy = AwsBindingStrategy.EIP;
private int minAvailableInstancesForPeerReplication = -1;
@Override @Override
public boolean shouldEnableSelfPreservation() { public boolean shouldEnableSelfPreservation() {
return this.enableSelfPreservation; return this.enableSelfPreservation;
...@@ -267,4 +269,9 @@ public class EurekaServerConfigBean implements EurekaServerConfig, EurekaConstan ...@@ -267,4 +269,9 @@ public class EurekaServerConfigBean implements EurekaServerConfig, EurekaConstan
} }
return null; return null;
} }
@Override
public int getHealthStatusMinNumberOfAvailablePeers() {
return this.minAvailableInstancesForPeerReplication;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment