Upgrade Eureka to v1.8.2

fixes gh-2216
parent c544f4ae
......@@ -15,7 +15,7 @@
<description>Spring Cloud Netflix Dependencies</description>
<properties>
<archaius.version>0.7.5</archaius.version>
<eureka.version>1.7.0</eureka.version>
<eureka.version>1.8.2</eureka.version>
<feign.version>9.5.0</feign.version>
<hystrix.version>1.5.12</hystrix.version>
<ribbon.version>2.2.2</ribbon.version>
......
......@@ -383,6 +383,12 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
*/
private String clientDataAccept = EurekaAccept.full.name();
/**
* Indicates whether the client should explicitly unregister itself from the remote server
* on client shutdown.
*/
private boolean unregisterOnShutdown = true;
@Override
public boolean shouldGZipContent() {
return this.gZipContent;
......@@ -414,6 +420,11 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
}
@Override
public boolean shouldUnregisterOnShutdown() {
return this.unregisterOnShutdown;
}
@Override
public String fetchRegistryForRemoteRegions() {
return this.fetchRemoteRegionsRegistry;
}
......
......@@ -5,6 +5,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.function.Supplier;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
......@@ -84,8 +85,9 @@ public class CloudJacksonJson extends LegacyJacksonJson {
module.addSerializer(Applications.class, new ApplicationsSerializer(
this.getVersionDeltaKey(), this.getAppHashCodeKey()));
module.addDeserializer(DataCenterInfo.class,
new DataCenterInfoDeserializer());
// TODO: Watch if this causes problems
// module.addDeserializer(DataCenterInfo.class,
// new DataCenterInfoDeserializer());
module.addDeserializer(LeaseInfo.class, new LeaseInfoDeserializer());
module.addDeserializer(InstanceInfo.class,
new CloudInstanceInfoDeserializer(mapper));
......@@ -96,12 +98,12 @@ public class CloudJacksonJson extends LegacyJacksonJson {
mapper.registerModule(module);
HashMap<Class<?>, ObjectReader> readers = new HashMap<>();
readers.put(InstanceInfo.class, mapper.reader().withType(InstanceInfo.class)
HashMap<Class<?>, Supplier<ObjectReader>> readers = new HashMap<>();
readers.put(InstanceInfo.class, ()-> mapper.reader().withType(InstanceInfo.class)
.withRootName("instance"));
readers.put(Application.class, mapper.reader().withType(Application.class)
readers.put(Application.class, ()-> mapper.reader().withType(Application.class)
.withRootName("application"));
readers.put(Applications.class, mapper.reader().withType(Applications.class)
readers.put(Applications.class, ()-> mapper.reader().withType(Applications.class)
.withRootName("applications"));
setField("objectReaderByClass", readers);
......
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