From c906f6b8ea3d0d796a6755933e6ede78a1315f97 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 27 May 2020 18:13:35 +0000 Subject: [PATCH] Sync docs from 2.2.x to gh-pages --- 2.2.x/reference/html/appendix.html | 10 +++++ 2.2.x/reference/html/index.html | 39 ++++++++++++++----- .../reference/html/spring-cloud-commons.html | 39 ++++++++++++++----- 3 files changed, 70 insertions(+), 18 deletions(-) diff --git a/2.2.x/reference/html/appendix.html b/2.2.x/reference/html/appendix.html index 288d1d67..ea4ed70a 100644 --- a/2.2.x/reference/html/appendix.html +++ b/2.2.x/reference/html/appendix.html @@ -275,6 +275,11 @@ Also, you can define your own properties.

Initial cache capacity expressed as int.

+

spring.cloud.loadbalancer.cache.enabled

+

true

+

Enables Spring Cloud LoadBalancer caching mechanism.

+ +

spring.cloud.loadbalancer.cache.ttl

35s

Time To Live - time counted from writing of the record, after which cache entries are expired, expressed as a {@link Duration}. The property {@link String} has to be in keeping with the appropriate syntax as specified in Spring Boot <code>StringToDurationConverter</code>. @see <a href= "https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToDurationConverter.java">StringToDurationConverter.java</a>

@@ -305,6 +310,11 @@ Also, you can define your own properties.

Causes RibbonLoadBalancerClient to be used by default.

+

spring.cloud.loadbalancer.service-discovery.timeout

+ +

String representation of Duration of the timeout for calls to service discovery.

+ +

spring.cloud.loadbalancer.zone

Spring Cloud LoadBalancer zone.

diff --git a/2.2.x/reference/html/index.html b/2.2.x/reference/html/index.html index c61a5f7e..0cdbc229 100644 --- a/2.2.x/reference/html/index.html +++ b/2.2.x/reference/html/index.html @@ -1614,6 +1614,15 @@ healthy instances after querying the external ServiceDiscovery. +
+
+
TIP
+
+

This supplier is also recommended for setups with a small number of instances per service +in order to avoid retrying calls on a failing instance.

+
+
+

HealthCheckServiceInstanceListSupplier uses properties prefixed with spring.cloud.loadbalancer.healthcheck. You can set the initialDelay and interval @@ -1621,12 +1630,20 @@ for the scheduler. You can set the default path for the healthcheck URL by setti the value of the spring.cloud.loadbalancer.healthcheck.path.default. You can also set a specific value for any given service by setting the value of the spring.cloud.loadbalancer.healthcheck.path.[SERVICE_ID], substituting the [SERVICE_ID] with the correct ID of your service. If the path is not set, /actuator/health is used by default.

+
+
+
TIP
+
+

If you rely on the default path (/actuator/health), make sure you add spring-boot-starter-actuator to your collaborator’s dependencies, unless you are planning to add such an endpoint on your own.

+
+
+

In order to use the health-check scheduler approach, you will have to instantiate a HealthCheckServiceInstanceListSupplier bean in a custom configuration.

We use delegates to work with ServiceInstanceListSupplier beans. -We suggest passing a DiscoveryClientServiceInstanceListSupplier delegate in the constructor of HealthCheckServiceInstanceListSupplier and, in turn, wrapping the latter with a CachingServiceInstanceListSupplier to leverage LoadBalancer caching mechanism.

+We suggest passing a DiscoveryClientServiceInstanceListSupplier delegate in the constructor of HealthCheckServiceInstanceListSupplier.

You could use this sample configuration to set it up:

@@ -1652,14 +1669,6 @@ We suggest passing a DiscoveryClientServiceInstanceListSupplier del

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.

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

-
@@ -1718,6 +1727,18 @@ public class MyConfiguration { } +
+
+
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.

+
+
+
diff --git a/2.2.x/reference/html/spring-cloud-commons.html b/2.2.x/reference/html/spring-cloud-commons.html index c61a5f7e..0cdbc229 100644 --- a/2.2.x/reference/html/spring-cloud-commons.html +++ b/2.2.x/reference/html/spring-cloud-commons.html @@ -1614,6 +1614,15 @@ healthy instances after querying the external ServiceDiscovery.
+
+
+
TIP
+
+

This supplier is also recommended for setups with a small number of instances per service +in order to avoid retrying calls on a failing instance.

+
+
+

HealthCheckServiceInstanceListSupplier uses properties prefixed with spring.cloud.loadbalancer.healthcheck. You can set the initialDelay and interval @@ -1621,12 +1630,20 @@ for the scheduler. You can set the default path for the healthcheck URL by setti the value of the spring.cloud.loadbalancer.healthcheck.path.default. You can also set a specific value for any given service by setting the value of the spring.cloud.loadbalancer.healthcheck.path.[SERVICE_ID], substituting the [SERVICE_ID] with the correct ID of your service. If the path is not set, /actuator/health is used by default.

+
+
+
TIP
+
+

If you rely on the default path (/actuator/health), make sure you add spring-boot-starter-actuator to your collaborator’s dependencies, unless you are planning to add such an endpoint on your own.

+
+
+

In order to use the health-check scheduler approach, you will have to instantiate a HealthCheckServiceInstanceListSupplier bean in a custom configuration.

We use delegates to work with ServiceInstanceListSupplier beans. -We suggest passing a DiscoveryClientServiceInstanceListSupplier delegate in the constructor of HealthCheckServiceInstanceListSupplier and, in turn, wrapping the latter with a CachingServiceInstanceListSupplier to leverage LoadBalancer caching mechanism.

+We suggest passing a DiscoveryClientServiceInstanceListSupplier delegate in the constructor of HealthCheckServiceInstanceListSupplier.

You could use this sample configuration to set it up:

@@ -1652,14 +1669,6 @@ We suggest passing a DiscoveryClientServiceInstanceListSupplier del

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.

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

-
@@ -1718,6 +1727,18 @@ public class MyConfiguration { } +
+
+
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.

+
+
+