[QUESTION] Using circuit breaker and retry together
See original GitHub issueResilience4j version: v1.4.0
Java version: 11
Hey team, I had a few questions regarding the use of CB and retry together:
- Is there any documentation out there for how to get that set up? I’m confused as to how the retry fallbacks and circuit breaker fallbacks and state transitions work together.
- My use case is to send some data to a Kafka cluster through a decorated
Consumer
and I’m using thedecorateConsumer
method from aCircuitBreaker
but to execute it I don’t see any methods. Currently I’m just calling theaccept
method from aConsumer
interface, is there any other way to run a decoratedConsumer
? - If I want to decorate a
Consumer
with bothCircuitBreaker
andRetry
is there any way to do so without using thedecorators
dependency? I’m thinking of having just ther4j-circuitbreaker
andr4j-retry
dependencies and decorate theConsumer
with one and save it in a variable and then decorate the new saved variable with the other. Thoughts on this?
EDIT:
- For custom configuration for either decorators, if I use a custom config and only set a few of the options available, what happens for the other ones. For example if I use
CircuitBreakerConfig
object and build a custom config that only defines a failure threshold in half open state and closed state, what happens to all the other configuration properties that can be set such as number of calls permitted in half-open state, etc. Does it still use the default values for all the other properties and only overrides the ones I’ve set in the custom config object that is passed to theCircuitBreakerRegistry
orCircuitBreaker
directly? - Is there any retry functionality built into
CircuitBreaker
where if an error occurs then it stores the data that was supposed to be sent and then re-sent it. And ifRetry
is supposed to be used for that purpose, doesRetry
have a buffer where it stores the data that should’ve been sent and that it needs to retry sending? Or does theRetry
functionality work on each call of aConsumer
/Supplier
/etc. at a time so it doesn’t care if 100 calls fail in a second because it’ll retry it with whatever logic is set up for each of those 100 calls separately in the same or new thread(s)?
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
How to combine Retryable and CircuitBreaker together in ...
When Retry from Circuit Breaker is implemented, circuit breaker will see errors only after retries are complete. In this approach, thresholds ...
Read more >Circuit Breaker and Retry - Dan Tran - Medium
Circuit breaker is commonly used in stateless online transaction systems, especially at the integration points. Retry should use for scheduling ...
Read more >Retry vs Circuit Breaker - DEV Community
The purpose of the Circuit Breaker pattern is different than the Retry pattern. The Retry pattern enables an application to retry an operation ......
Read more >Designing Resilient Systems: Circuit Breakers or Retries ...
This post is the second part of the series on Designing Resilient Systems. In Part 1, we looked at use cases for implementing...
Read more >Circuit Breaker pattern - Azure Architecture Center
An application can combine these two patterns by using the Retry pattern to invoke an operation through a circuit breaker. However, the retry...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Will do, thanks!
EDIT: Submitted.
You can suggest edits.