diff --git a/2.2.x/reference/html/index.html b/2.2.x/reference/html/index.html
index 2047e623..9de00344 100644
--- a/2.2.x/reference/html/index.html
+++ b/2.2.x/reference/html/index.html
@@ -1581,22 +1581,14 @@ We suggest passing a DiscoveryClientServiceInstanceListSupplier del
@Bean
public ServiceInstanceListSupplier discoveryClientServiceInstanceListSupplier(
- ReactiveDiscoveryClient discoveryClient, Environment environment,
- LoadBalancerZoneConfig zoneConfig,
- ApplicationContext context) {
- DiscoveryClientServiceInstanceListSupplier firstDelegate = new DiscoveryClientServiceInstanceListSupplier(
- discoveryClient, environment);
- ZonePreferenceServiceInstanceListSupplier delegate = new ZonePreferenceServiceInstanceListSupplier(firstDelegate,
- zoneConfig);
- ObjectProvider<LoadBalancerCacheManager> cacheManagerProvider = context
- .getBeanProvider(LoadBalancerCacheManager.class);
- if (cacheManagerProvider.getIfAvailable() != null) {
- return new CachingServiceInstanceListSupplier(delegate,
- cacheManagerProvider.getIfAvailable());
- }
- return delegate;
+ ConfigurableApplicationContext context) {
+ return ServiceInstanceListSuppliers.builder()
+ .withDiscoveryClient()
+ .withZonePreference()
+ .withCaching()
+ .build(context);
}
- }
+}
@@ -1645,25 +1637,24 @@ We suggest passing a DiscoveryClientServiceInstanceListSupplier del
@Bean
public ServiceInstanceListSupplier discoveryClientServiceInstanceListSupplier(
- ReactiveDiscoveryClient discoveryClient, Environment environment,
- LoadBalancerProperties loadBalancerProperties,
- ApplicationContext context,
- InstanceHealthChecker healthChecker) {
- DiscoveryClientServiceInstanceListSupplier firstDelegate = new DiscoveryClientServiceInstanceListSupplier(
- discoveryClient, environment);
- HealthCheckServiceInstanceListSupplier delegate = new HealthCheckServiceInstanceListSupplier(firstDelegate,
- loadBalancerProperties, healthChecker);
- ObjectProvider<LoadBalancerCacheManager> cacheManagerProvider = context
- .getBeanProvider(LoadBalancerCacheManager.class);
- if (cacheManagerProvider.getIfAvailable() != null) {
- return new CachingServiceInstanceListSupplier(delegate,
- cacheManagerProvider.getIfAvailable());
+ ConfigurableApplicationContext context) {
+ return ServiceInstanceListSuppliers.builder()
+ .withDiscoveryClient()
+ .withHealthChecks()
+ .withCaching()
+ .build(context);
}
- return delegate;
- }
}
+
In order to make working on your own LoadBalancer configuration easier, we have added some utility methods in ServiceInstanceListSuppliers class.
DiscoveryClientServiceInstanceListSupplier del
@Bean
public ServiceInstanceListSupplier discoveryClientServiceInstanceListSupplier(
- ReactiveDiscoveryClient discoveryClient, Environment environment,
- LoadBalancerZoneConfig zoneConfig,
- ApplicationContext context) {
- DiscoveryClientServiceInstanceListSupplier firstDelegate = new DiscoveryClientServiceInstanceListSupplier(
- discoveryClient, environment);
- ZonePreferenceServiceInstanceListSupplier delegate = new ZonePreferenceServiceInstanceListSupplier(firstDelegate,
- zoneConfig);
- ObjectProvider<LoadBalancerCacheManager> cacheManagerProvider = context
- .getBeanProvider(LoadBalancerCacheManager.class);
- if (cacheManagerProvider.getIfAvailable() != null) {
- return new CachingServiceInstanceListSupplier(delegate,
- cacheManagerProvider.getIfAvailable());
- }
- return delegate;
+ ConfigurableApplicationContext context) {
+ return ServiceInstanceListSuppliers.builder()
+ .withDiscoveryClient()
+ .withZonePreference()
+ .withCaching()
+ .build(context);
}
- }
+}
DiscoveryClientServiceInstanceListSupplier del
@Bean
public ServiceInstanceListSupplier discoveryClientServiceInstanceListSupplier(
- ReactiveDiscoveryClient discoveryClient, Environment environment,
- LoadBalancerProperties loadBalancerProperties,
- ApplicationContext context,
- InstanceHealthChecker healthChecker) {
- DiscoveryClientServiceInstanceListSupplier firstDelegate = new DiscoveryClientServiceInstanceListSupplier(
- discoveryClient, environment);
- HealthCheckServiceInstanceListSupplier delegate = new HealthCheckServiceInstanceListSupplier(firstDelegate,
- loadBalancerProperties, healthChecker);
- ObjectProvider<LoadBalancerCacheManager> cacheManagerProvider = context
- .getBeanProvider(LoadBalancerCacheManager.class);
- if (cacheManagerProvider.getIfAvailable() != null) {
- return new CachingServiceInstanceListSupplier(delegate,
- cacheManagerProvider.getIfAvailable());
+ ConfigurableApplicationContext context) {
+ return ServiceInstanceListSuppliers.builder()
+ .withDiscoveryClient()
+ .withHealthChecks()
+ .withCaching()
+ .build(context);
}
- return delegate;
- }
}
+In order to make working on your own LoadBalancer configuration easier, we have added some utility methods in ServiceInstanceListSuppliers class.