Renames ServiceInstanceListSuppliers to ServiceInstanceListSupplierBuilder (#761)

Puts static builder() method on ServiceInstanceListSupplier.

Deprecates ServiceInstanceListSupplier.fixed(Environment) and replaces with fixed(serviceId).
This commit is contained in:
Spencer Gibb
2020-05-21 14:08:09 -04:00
committed by spencergibb
parent 2b30b355b6
commit 83bb54bafd
7 changed files with 297 additions and 272 deletions

View File

@@ -932,7 +932,7 @@ public class CustomLoadBalancerConfiguration {
@Bean
public ServiceInstanceListSupplier discoveryClientServiceInstanceListSupplier(
ConfigurableApplicationContext context) {
return ServiceInstanceListSuppliers.builder()
return ServiceInstanceListSupplier.builder()
.withDiscoveryClient()
.withHealthChecks()
.withCaching()
@@ -941,7 +941,7 @@ public class CustomLoadBalancerConfiguration {
}
----
TIP:: In order to make working on your own LoadBalancer configuration easier, we have added some utility methods in `ServiceInstanceListSuppliers` class.
TIP:: In order to make working on your own LoadBalancer configuration easier, we have added a `builder()` method to the `ServiceInstanceListSupplier` class.
TIP:: You can also use our alternative predefined configurations in place of the default ones by setting the value of `spring.cloud.loadbalancer.configurations` property to `zone-preference` to use `ZonePreferenceServiceInstanceListSupplier` with caching or to `health-check` to use `HealthCheckServiceInstanceListSupplier` with caching.