Remove LB caching from default health-check config, since HealthCheckServiceInstanceListSupplier has a separate caching mechanism. Fixes gh-849.

This commit is contained in:
Olga Maciaszek-Sharma
2020-11-16 13:11:35 +01:00
parent 259df6f4ee
commit 17e9a2af38
2 changed files with 5 additions and 8 deletions

View File

@@ -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

View File

@@ -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);
});
}