resilience4j: CircuitBreakerEvents not Publishing to CircuitBreakerEvents Endpoint.
After configuring the spring property management.endpoint.circuitbreakerevents.enabled=true there is no output on either success or error events.
Here are my configuration properties for test…
...
management.endpoints.web.base-path=/server
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
management.health.defaults.enabled=true
management.health.circuitbreakers.enabled=true
management.endpoint.circuitbreakerevents.enabled=true
management.metrics.distribution.percentiles-histogram.http.server.requests= true
management.metrics.distribution.percentiles-histogram.resilience4j.circuitbreaker.calls= true
//wcw service config
resilience4j.circuitbreaker.backends.wcw.register-health-indicator=true
resilience4j.circuitbreaker.backends.wcw.sliding-window-size=10
resilience4j.circuitbreaker.backends.wcw.permitted-number-of-calls-in-half-open-state=30
resilience4j.circuitbreaker.backends.wcw.sliding-window-type=count_based
resilience4j.circuitbreaker.backends.wcw.wait-duration-in-open-state=1s
resilience4j.circuitbreaker.backends.wcw.minimum-number-of-calls=100
resilience4j.circuitbreaker.backends.wcw.slow-call-duration-threshold=60
resilience4j.circuitbreaker.backends.wcw.failure-rate-threshold=50
resilience4j.circuitbreaker.backends.wcw.event-consumer-buffer-size=10
resilience4j.circuitbreaker.backends.wcw.writable-stack-trace-enabled=true
resilience4j.circuitbreaker.backends.wcw.record-exceptions=org.springframework.ws.client.WebServiceIOException
resilience4j.circuitbreaker.backends.wcw.ignore-exceptions=
The output for the endpoint config at /server/circuitbreakers shows status up and working…
{
circuitBreakers: [
"wcw"
]
}
A MockMVC Response confirms the the CircuitBreaker recorded a failed event. However, the ouput at /server/circuitbreakerevents/wcw is empty.
[2019-09-30 18:27:04.152] [DEBUG] [PID: 17144] :: [CID: ] :: [main] [tBreakerStateMachine] :: Event ERROR published: 2019-09-30T18:27:04.151-05:00[America/Chicago]: CircuitBreaker 'wcw' recorded an error: 'org.springframework.ws.client.WebServiceIOException: I/O error: Connect to 127.0.0.1:8888 [/127.0.0.1] failed: Connection refused: connect; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:8888 [/127.0.0.1] failed: Connection refused: connect'. Elapsed time: 2240 ms
{
circuitBreakerEvents: [ ]
}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (8 by maintainers)
Ah… yes… You’re running with
WebEnvironment.RANDOM_PORTand I’m running the tests withWebEnvironment.MOCKwith the main application running so that would explain the difference.Thank you for the excellent assistance @RobWin … I would consider this resolved.
The events are registering during runtime…
Endpoint works for me: