Files
spring-boot-demo/resilience4j-circuit-breaker/src/main/resources/application.yml
T

89 lines
2.3 KiB
YAML

spring:
application:
name: resilience-boot4-demo
server:
port: 8080
management:
endpoints:
web:
exposure:
include: health,metrics,circuitbreakers,circuitbreakerevents
endpoint:
health:
show-details: always
health:
circuitbreakers:
enabled: true
resilience4j:
circuitbreaker:
instances:
paymentService:
slidingWindowType: COUNT_BASED
slidingWindowSize: 10
minimumNumberOfCalls: 5
failureRateThreshold: 50
waitDurationInOpenState: 2s
permittedNumberOfCallsInHalfOpenState: 2
automaticTransitionFromOpenToHalfOpenEnabled: true
recordExceptions:
- com.ankurm.resilience.FlakyDownstream$DownstreamUnavailableException
# Opens on latency alone: every call succeeds, but 2 of 4 take longer than 200ms.
slowBreaker:
slidingWindowType: COUNT_BASED
slidingWindowSize: 4
minimumNumberOfCalls: 4
failureRateThreshold: 50
slowCallDurationThreshold: 200ms
slowCallRateThreshold: 50
waitDurationInOpenState: 5s
# Sits behind @TimeLimiter: each timeout is one recorded failure.
timeoutBreaker:
slidingWindowType: COUNT_BASED
slidingWindowSize: 4
minimumNumberOfCalls: 4
failureRateThreshold: 50
waitDurationInOpenState: 5s
# Identical pair; the only difference is ignoreExceptions.
lookupCounted:
slidingWindowSize: 4
minimumNumberOfCalls: 4
failureRateThreshold: 50
waitDurationInOpenState: 5s
lookupIgnored:
slidingWindowSize: 4
minimumNumberOfCalls: 4
failureRateThreshold: 50
waitDurationInOpenState: 5s
ignoreExceptions:
- com.ankurm.resilience.r4j.ProductNotFoundException
timelimiter:
instances:
slowLookup:
timeoutDuration: 500ms
cancelRunningFuture: true
ratelimiter:
instances:
searchApi:
limitForPeriod: 3
limitRefreshPeriod: 1s
timeoutDuration: 0
bulkhead:
instances:
slowOp:
maxConcurrentCalls: 2
maxWaitDuration: 100ms
retry:
instances:
inventoryService:
maxAttempts: 3
waitDuration: 200ms
enableExponentialBackoff: true
exponentialBackoffMultiplier: 2
logging:
level:
com.ankurm.resilience: INFO