From a5781f19af8f2013f4af2a30e1805573eccaeddb Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 22 Nov 2019 14:55:02 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- reference/html/index.html | 60 +++++++++++++++++++----- reference/html/spring-cloud-commons.html | 60 +++++++++++++++++++----- 2 files changed, 96 insertions(+), 24 deletions(-) diff --git a/reference/html/index.html b/reference/html/index.html index e33efef6..6bf2d147 100644 --- a/reference/html/index.html +++ b/reference/html/index.html @@ -157,8 +157,9 @@ $(addBlockSwitches);
  • 3. Spring Cloud LoadBalancer
  • 4. Spring Cloud Circuit Breaker @@ -1343,11 +1344,28 @@ in the following sections:

    -

    3.2. Spring Cloud LoadBalancer starter

    +

    3.2. Spring Cloud LoadBalancer Caching

    -

    We also provide a starter that allows you to easily add Spring Cloud LoadBalancer in a Spring Boot app. -In order to use it, just add org.springframework.cloud:spring-cloud-starter-loadbalancer to your Spring -Cloud dependencies in your build file.

    +

    Apart from the basic ServiceInstanceListSupplier implementation that retrieves instances +via DiscoveryClient each time it has to choose an instance, we provide a Caffeine-backed +implementation. +To make use of it, you need to have com.github.ben-manes.caffeine:caffeine in the classpath. +The default setup includes expireAfterWrite set to 30 seconds and records set to soft references.

    +
    +
    +

    You can set your own TTL value (the time after write after which entries should be expired), expressed as Duration, by passing a String compliant with the Duration API +as the value of spring.cloud.loadbalancer.cache.ttl property.

    +
    +
    +

    You can also override the default Caffeine Cache setup for the LoadBalancer by passing your own Caffeine Specification +in the spring.cloud.loadbalancer.cache.caffeine.spec property.

    +
    +
    +

    WARN: Passing your own Caffeine specification will override any other LoadBalancerCache settings, including TTL.

    +
    +
    +

    You can also altogether disable loadBalancer caching by setting the value of spring.cloud.loadbalancer.cache.enabled +to false.

    @@ -1356,11 +1374,29 @@ Cloud dependencies in your build file.

    + +
    -In order to make use of the more efficient cached version of ServiceInstanceListSupplier, - spring-cloud-starter-loadbalancer will enable caching by default. -Spring Boot Caching -mechanism will be used under the hood. If you don’t want caching to be used, you can set -the value of spring.cache.type to none. +Although the basic, non-cached, implementation is useful for prototyping and testing, it’s much less efficient +than the cached versions, so we recommend always using the cached version in production. +
    +
    +
    +
    +

    3.3. Spring Cloud LoadBalancer starter

    +
    +

    We also provide a starter that allows you to easily add Spring Cloud LoadBalancer in a Spring Boot app. +In order to use it, just add org.springframework.cloud:spring-cloud-starter-loadbalancer to your Spring +Cloud dependencies in your build file.

    +
    +
    + + + +
    + + +Spring Cloud LoadBalancer starter includes +Spring Boot Caching.
    @@ -1382,7 +1418,7 @@ make sure you set the property spring.cloud.loadbalancer.ribbon.enabled
    -

    3.3. Passing your own Spring Cloud LoadBalancer configuration

    +

    3.4. Passing your own Spring Cloud LoadBalancer configuration

    You can also use the @LoadBalancerClient annotation to pass your own load-balancer client configuration, passing the name of the load-balancer client and the configuration class, like so:

    diff --git a/reference/html/spring-cloud-commons.html b/reference/html/spring-cloud-commons.html index e33efef6..6bf2d147 100644 --- a/reference/html/spring-cloud-commons.html +++ b/reference/html/spring-cloud-commons.html @@ -157,8 +157,9 @@ $(addBlockSwitches);
  • 3. Spring Cloud LoadBalancer
  • 4. Spring Cloud Circuit Breaker @@ -1343,11 +1344,28 @@ in the following sections:

    -

    3.2. Spring Cloud LoadBalancer starter

    +

    3.2. Spring Cloud LoadBalancer Caching

    -

    We also provide a starter that allows you to easily add Spring Cloud LoadBalancer in a Spring Boot app. -In order to use it, just add org.springframework.cloud:spring-cloud-starter-loadbalancer to your Spring -Cloud dependencies in your build file.

    +

    Apart from the basic ServiceInstanceListSupplier implementation that retrieves instances +via DiscoveryClient each time it has to choose an instance, we provide a Caffeine-backed +implementation. +To make use of it, you need to have com.github.ben-manes.caffeine:caffeine in the classpath. +The default setup includes expireAfterWrite set to 30 seconds and records set to soft references.

    +
    +
    +

    You can set your own TTL value (the time after write after which entries should be expired), expressed as Duration, by passing a String compliant with the Duration API +as the value of spring.cloud.loadbalancer.cache.ttl property.

    +
    +
    +

    You can also override the default Caffeine Cache setup for the LoadBalancer by passing your own Caffeine Specification +in the spring.cloud.loadbalancer.cache.caffeine.spec property.

    +
    +
    +

    WARN: Passing your own Caffeine specification will override any other LoadBalancerCache settings, including TTL.

    +
    +
    +

    You can also altogether disable loadBalancer caching by setting the value of spring.cloud.loadbalancer.cache.enabled +to false.

    @@ -1356,11 +1374,29 @@ Cloud dependencies in your build file.

    + +
    -In order to make use of the more efficient cached version of ServiceInstanceListSupplier, - spring-cloud-starter-loadbalancer will enable caching by default. -Spring Boot Caching -mechanism will be used under the hood. If you don’t want caching to be used, you can set -the value of spring.cache.type to none. +Although the basic, non-cached, implementation is useful for prototyping and testing, it’s much less efficient +than the cached versions, so we recommend always using the cached version in production. +
    +
    +
    +
    +

    3.3. Spring Cloud LoadBalancer starter

    +
    +

    We also provide a starter that allows you to easily add Spring Cloud LoadBalancer in a Spring Boot app. +In order to use it, just add org.springframework.cloud:spring-cloud-starter-loadbalancer to your Spring +Cloud dependencies in your build file.

    +
    +
    + + + +
    + + +Spring Cloud LoadBalancer starter includes +Spring Boot Caching.
    @@ -1382,7 +1418,7 @@ make sure you set the property spring.cloud.loadbalancer.ribbon.enabled
    -

    3.3. Passing your own Spring Cloud LoadBalancer configuration

    +

    3.4. Passing your own Spring Cloud LoadBalancer configuration

    You can also use the @LoadBalancerClient annotation to pass your own load-balancer client configuration, passing the name of the load-balancer client and the configuration class, like so: