Upgrade Eureka to v1.8.2

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