Merge branch '3.1.x'
This commit is contained in:
@@ -376,6 +376,47 @@ public class FooConfiguration {
|
||||
|
||||
To enable Spring Cloud CircuitBreaker group set the `spring.cloud.openfeign.circuitbreaker.group.enabled` property to `true` (by default `false`).
|
||||
|
||||
[[spring-clou-feign-circuitbreaker-configurationproperties]]
|
||||
=== Configuring CircuitBreakers With Configuration Properties
|
||||
|
||||
You can configure CircuitBreakers via configuration properties. To do set
|
||||
`feign.circuitbreaker.alphanumeric-ids.enabled` to `true`. Since
|
||||
you cannot use characters like `#`, `(`, `)` `,` in configuration property names we need to
|
||||
change the naming convention for the ids of the circuit breakers generated by OpenFeign. The above
|
||||
property will do this for you.
|
||||
|
||||
For example, if you had this Feign client
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
@FeignClienturl = "http://localhost:8080")
|
||||
public interface DemoClient {
|
||||
|
||||
@GetMapping("demo")
|
||||
String getDemo();
|
||||
}
|
||||
----
|
||||
|
||||
You could configure it using configuration properties by doing the following
|
||||
|
||||
[source,yaml,indent=0]
|
||||
----
|
||||
feign:
|
||||
circuitbreaker:
|
||||
enabled: true
|
||||
alphanumeric-ids:
|
||||
enabled: true
|
||||
resilience4j:
|
||||
circuitbreaker:
|
||||
instances:
|
||||
DemoClientgetDemo:
|
||||
minimumNumberOfCalls: 69
|
||||
timelimiter:
|
||||
instances:
|
||||
DemoClientgetDemo:
|
||||
timeoutDuration: 10s
|
||||
----
|
||||
|
||||
|
||||
[[spring-cloud-feign-circuitbreaker-fallback]]
|
||||
=== Feign Spring Cloud CircuitBreaker Fallbacks
|
||||
|
||||
Reference in New Issue
Block a user