Use spring-retry for consul config and discovery.

fixes gh-81
This commit is contained in:
Spencer Gibb
2016-02-02 16:32:12 -07:00
parent 6c0264bc89
commit 1c18c220fc
10 changed files with 121 additions and 0 deletions

View File

@@ -185,6 +185,21 @@ You could store a YAML document in any of the keys listed above.
You can change the data key using `spring.cloud.consul.config.data-key`.
[[spring-cloud-consul-retry]]
== Consul Retry
If you expect that the consul agent may occasionally be unavailable when
your app starts, you can ask it to keep trying after a failure. You need to add
`spring-retry` and `spring-boot-starter-aop` to your classpath. The default
behaviour is to retry 6 times with an initial backoff interval of 1000ms and an
exponential multiplier of 1.1 for subsequent backoffs. You can configure these
properties (and others) using `spring.cloud.consul.retry.*` configuration properties.
This works with both Spring Cloud Consul Config and Discovery registration.
TIP: To take full control of the retry add a `@Bean` of type
`RetryOperationsInterceptor` with id "consulRetryInterceptor". Spring
Retry has a `RetryInterceptorBuilder` that makes it easy to create one.
[[spring-cloud-consul-bus]]
== Spring Cloud Bus with Consul