配置

eureka 默认配置类 DefaultEurekaServerConfig

// 配置的驱逐时间
serverConfig.getEvictionIntervalTimerInMs();
// 获取续订百分比阈值
int registrySizeThreshold = (int) (registrySize * serverConfig.getRenewalPercentThreshold());

默认开启自我保护,是不会定时剔除实例的

@Override
public boolean isLeaseExpirationEnabled() {
if (!isSelfPreservationModeEnabled()) {
// The self preservation mode is disabled, hence allowing the instances to expire.
return true;
}
return numberOfRenewsPerMinThreshold > 0 && getNumOfRenewsInLastMin() > numberOfRenewsPerMinThreshold;
}

https://cloud.spring.io/spring-cloud-netflix/reference/html/#eurekaclient-without-jersey

默认情况下,EurekaClient 使用 Jersey 进行 HTTP 通信。如果希望避免来自 Jersey 的依赖关系,可以将其从依赖关系中排除。Spring Cloud 基于 Spring 自动配置传输客户端RestTemplate。以下示例显示排除了 Jersey:

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<exclusions>
<exclusion>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-apache-client4</artifactId>
</exclusion>
</exclusions>
</dependency>