public class CustomLoadBalancerConfiguration {
@@ -1603,7 +1603,6 @@ We suggest passing a DiscoveryClientServiceInstanceListSupplier del
return ServiceInstanceListSupplier.builder()
.withDiscoveryClient()
.withHealthChecks()
- .withCaching()
.build(context);
}
}
@@ -1611,6 +1610,10 @@ We suggest passing a
DiscoveryClientServiceInstanceListSupplier del
-
The default setup includes ttl set to 30 seconds and the default initialCapacity is 256.
+
The default setup includes ttl set to 35 seconds and the default initialCapacity is 256.
You can also altogether disable loadBalancer caching by setting the value of spring.cloud.loadbalancer.cache.enabled
@@ -1593,7 +1593,7 @@ We suggest passing a DiscoveryClientServiceInstanceListSupplier del
You could use this sample configuration to set it up:
-
+
public class CustomLoadBalancerConfiguration {
@@ -1603,7 +1603,6 @@ We suggest passing a DiscoveryClientServiceInstanceListSupplier del
return ServiceInstanceListSupplier.builder()
.withDiscoveryClient()
.withHealthChecks()
- .withCaching()
.build(context);
}
}
@@ -1611,6 +1610,10 @@ We suggest passing a
DiscoveryClientServiceInstanceListSupplier del
+- NOTE
+-
+
HealthCheckServiceInstanceListSupplier has its own caching mechanism based on Reactor Flux replay(), therefore, if it’s being used, you may want to skip wrapping that supplier with CachingServiceInstanceListSupplier.
+
- TIP
-
In order to make working on your own LoadBalancer configuration easier, we have added a builder() method to the ServiceInstanceListSupplier class.