From 5a0ff3b03d64c650aca1e0be694b1850de75d040 Mon Sep 17 00:00:00 2001
From: buildmaster
Date: Wed, 22 Nov 2017 00:22:57 +0000
Subject: [PATCH] Sync docs from 2.0.x to gh-pages
---
...pring_cloud_commons_common_abstractions.html | 15 ++++++++++++++-
2.0.x/single/spring-cloud-commons.html | 15 ++++++++++++++-
2.0.x/spring-cloud-commons.xml | 17 ++++++++++++++++-
3 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/2.0.x/multi/multi__spring_cloud_commons_common_abstractions.html b/2.0.x/multi/multi__spring_cloud_commons_common_abstractions.html
index 05055e77..e8130565 100644
--- a/2.0.x/multi/multi__spring_cloud_commons_common_abstractions.html
+++ b/2.0.x/multi/multi__spring_cloud_commons_common_abstractions.html
@@ -44,7 +44,20 @@ you can set spring.cloud.loadbalancer.retry.enabled=false<
The properties you can use are client.ribbon.MaxAutoRetries,
client.ribbon.MaxAutoRetriesNextServer, and client.ribbon.OkToRetryOnAllOperations.
See the Ribbon documentation
-for a description of what there properties do.
Note
client in the above examples should be replaced with your Ribbon client’s
+for a description of what there properties do.
If you would like to implement a BackOffPolicy in your retries you will need to
+create a bean of type LoadBalancedBackOffPolicyFactory, and return the BackOffPolicy
+you would like to use for a given service.
client in the above examples should be replaced with your Ribbon client’s
name.
2.3.2 Multiple RestTemplate objects
If you want a RestTemplate that is not load balanced, create a RestTemplate
bean and inject it as normal. To access the load balanced RestTemplate use
the @LoadBalanced qualifier when you create your @Bean.
Important
Notice the @Primary annotation on the plain RestTemplate declaration in the example below, to disambiguate the unqualified @Autowired injection.
@Configuration
diff --git a/2.0.x/single/spring-cloud-commons.html b/2.0.x/single/spring-cloud-commons.html
index 48f19949..4a09ce5e 100644
--- a/2.0.x/single/spring-cloud-commons.html
+++ b/2.0.x/single/spring-cloud-commons.html
@@ -231,7 +231,20 @@ you can set spring.cloud.loadbalancer.retry.enabled=false<
The properties you can use are client.ribbon.MaxAutoRetries,
client.ribbon.MaxAutoRetriesNextServer, and client.ribbon.OkToRetryOnAllOperations.
See the Ribbon documentation
-for a description of what there properties do.
Note
client in the above examples should be replaced with your Ribbon client’s
+for a description of what there properties do.
If you would like to implement a BackOffPolicy in your retries you will need to
+create a bean of type LoadBalancedBackOffPolicyFactory, and return the BackOffPolicy
+you would like to use for a given service.
client in the above examples should be replaced with your Ribbon client’s
name.
2.3.2 Multiple RestTemplate objects
If you want a RestTemplate that is not load balanced, create a RestTemplate
bean and inject it as normal. To access the load balanced RestTemplate use
the @LoadBalanced qualifier when you create your @Bean.
Important
Notice the @Primary annotation on the plain RestTemplate declaration in the example below, to disambiguate the unqualified @Autowired injection.
@Configuration
diff --git a/2.0.x/spring-cloud-commons.xml b/2.0.x/spring-cloud-commons.xml
index c919bdb6..1543a759 100644
--- a/2.0.x/spring-cloud-commons.xml
+++ b/2.0.x/spring-cloud-commons.xml
@@ -4,7 +4,7 @@
Cloud Native Applications
-2017-11-21
+2017-11-22
@@ -412,6 +412,21 @@ The properties you can use are client.ribbon.MaxAutoRetries,
client.ribbon.MaxAutoRetriesNextServer, and client.ribbon.OkToRetryOnAllOperations.
See the Ribbon documentation
for a description of what there properties do.
+If you would like to implement a BackOffPolicy in your retries you will need to
+create a bean of type LoadBalancedBackOffPolicyFactory, and return the BackOffPolicy
+you would like to use for a given service.
+@Configuration
+public class MyConfiguration {
+ @Bean
+ LoadBalancedBackOffPolicyFactory backOffPolciyFactory() {
+ return new LoadBalancedBackOffPolicyFactory() {
+ @Override
+ public BackOffPolicy createBackOffPolicy(String service) {
+ return new ExponentialBackOffPolicy();
+ }
+ };
+ }
+}client in the above examples should be replaced with your Ribbon client’s
name.