Remove LB caching from default health-check config, since HealthCheckServiceInstanceListSupplier has a separate caching mechanism. Fixes gh-849.
This commit is contained in:
@@ -97,7 +97,7 @@ public class LoadBalancerClientConfiguration {
|
||||
public ServiceInstanceListSupplier healthCheckDiscoveryClientServiceInstanceListSupplier(
|
||||
ConfigurableApplicationContext context) {
|
||||
return ServiceInstanceListSupplier.builder().withDiscoveryClient()
|
||||
.withHealthChecks().withCaching().build(context);
|
||||
.withHealthChecks().build(context);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -154,7 +154,7 @@ public class LoadBalancerClientConfiguration {
|
||||
public ServiceInstanceListSupplier healthCheckDiscoveryClientServiceInstanceListSupplier(
|
||||
ConfigurableApplicationContext context) {
|
||||
return ServiceInstanceListSupplier.builder().withBlockingDiscoveryClient()
|
||||
.withHealthChecks().withCaching().build(context);
|
||||
.withHealthChecks().build(context);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -113,14 +113,11 @@ class LoadBalancerClientConfigurationTests {
|
||||
.run(context -> {
|
||||
ServiceInstanceListSupplier supplier = context
|
||||
.getBean(ServiceInstanceListSupplier.class);
|
||||
then(supplier).isInstanceOf(CachingServiceInstanceListSupplier.class);
|
||||
then(supplier)
|
||||
.isInstanceOf(HealthCheckServiceInstanceListSupplier.class);
|
||||
ServiceInstanceListSupplier delegate = ((DelegatingServiceInstanceListSupplier) supplier)
|
||||
.getDelegate();
|
||||
then(delegate)
|
||||
.isInstanceOf(HealthCheckServiceInstanceListSupplier.class);
|
||||
ServiceInstanceListSupplier secondDelegate = ((DelegatingServiceInstanceListSupplier) delegate)
|
||||
.getDelegate();
|
||||
then(secondDelegate).isInstanceOf(
|
||||
then(delegate).isInstanceOf(
|
||||
DiscoveryClientServiceInstanceListSupplier.class);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user