New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing Resilience4j for spring boot 2 #785
Comments
Hi, you really want to invoke a fallback method if there are 5 errors per minute independently of the number of successful calls per minute? Sounds surprising to me. |
yeah that is what i am trying to achieve if there are 5 errors per minute it should go to fallback method. is that kind of scenario possible in resilience4j? |
But could you please explain why its unimportant for you if all other requests are successful within the minute? Lets assume you have 500 requests per minute. The failure rate would be just 1% if the remaining 495 requests were successful? |
It's currently not possible to transition a CircuitBreaker to OPEN just based on the number of failures per time frame. |
what is the parameter should we use if we want to transition a circuitbreaker to open based on number of failures per time frame. How the threshold limit is calculated? is it calculated no of calls per minute. |
How can we transition circuit breaker to open based on number of failures per timeframe for spring boot application |
Sry, it's not possible |
can you please tell me how the failure rate threshold limit is calculated? On what basis circuit breaker changes its state to open is it on threshold limit or ring buffer size in closed state? |
Its documented here https://resilience4j.readme.io/docs/circuitbreaker |
I have gone through the document and can you please tell how the failure rate threshold is calculated is it per minute? |
You have to use a Sliding Time Window of size 60 (seconds). |
If I use slidingwindowsize= 60 does failure rate threshold is calculated per every 60 seconds? |
No, not every 60 seconds, but the failure rate is calculated based on the requests from the last 60 seconds. The sliding window evicts old request outcomes every second. |
Suppose if there are 10 calls in a minute and 3 calls got failed so failure threshold is calculated for that minute right? Can you please give a brief explanation on this please |
I am confused about how the failure rate threshold is calculated. How to time based for sliding window in spring boot application.yml and what is eventbufferconsumersize |
@ramsirish , I guess you should follow the documentation and do some test run to understand, how it is working, the Lib is working as documented and whats expected out of the design pattern. |
@kuldeep gulati can we have a discussion regarding resilience4j offline? |
@RobWin How can i add time based sliding window in application.yml for spring boot application |
please tell what is eventbuffersize? |
It controls how many events are stored internally in a buffer and are shown at this endpoint: https://resilience4j.readme.io/docs/getting-started-3#section-events-endpoint |
|
Can we make a call to fallback method only after the circuit is open instead of making call to fallback method for every failure(exceptions which we record). Is it possible in resilience4j for spring boot application with annotations. |
@RobWin please answer my above question. |
I have used slidingWindowType: TIME_BASED and kept slidingWindowSize: 120 sec there were 20 requests failed out of total 20 requests that means failure rate threshold is 100% but still the circuit is not opening. application.yml- resilience4j.circuitbreaker: |
sorry if slidingWindowType: TIME_BASED is now working for me...I did not add minimum number of calls so failure rate was not calculated...Can we make a call to fallback method only after the circuit is open instead of making call to fallback method for every failure(exceptions which we record). Is it possible in resilience4j for spring boot application with annotations. |
@RobWin please help in my question above |
Yes, you can define multiple fallback methods with the same name, but with different signatures.
Please see: https://resilience4j.readme.io/docs/getting-started-3#section-annotations |
Hi Robwin, |
How many fallback methods did you define? Can you show me the signature? |
Hi @RobWin Do we need to download prometheous for monitoring circuit breaker stats? In what what we can integrate spring boot application where circuit breaker is implemented with prometheous and grafana. |
Did you have a look at the Spring Boot 2 Demo? |
yeah but you have added micrometer depenency in build.gradle. What are the other changes we need do we need prometheous and graphana download to our local system. |
can you please tell complete steps for creating a dashboard to monitor circuit breaker |
Not sure what you want to achieve? The demo uses Docker Compose to run Grafana and Prometheus. |
can't we do without using docker? |
Sure you can. The Grafana Dashboard is included in the demo repository. |
Thanks for raising a Resilience4j issue.
Please provide a brief description of your problem along with the versions you are using.
If possible, please also consider putting together a complete JUnit test that reproduces the issue.
Resilience4j version:1.1.0
Java version:8
Problem description:
I tried implementing circuit breaker using resilience4j and it was working fine. My requirement is that it should go to fall back method only when there are 5 errors/min. Is that possible in resilience4j?. Please provide a detailedsolution.
The text was updated successfully, but these errors were encountered: