Skip to content
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

Generic circuit breaker backend wrapper #23

Closed
adamw opened this issue Aug 4, 2017 · 3 comments
Closed

Generic circuit breaker backend wrapper #23

adamw opened this issue Aug 4, 2017 · 3 comments

Comments

@adamw
Copy link
Member

adamw commented Aug 4, 2017

Maybe integrate with Hystrix? https://github.com/Netflix/Hystrix

@ghostbuster91
Copy link
Contributor

Since hystrix is no longer actively developed I think that we should use resilience4j-circuitbreaker from https://github.com/resilience4j/resilience4j. There are integrators for retrofit and feign so we can look how they were made.

@adamw
Copy link
Member Author

adamw commented Oct 21, 2019

I'm not really sure if we should do this task, or not. There's resilience4j, but there's also akka's circuit breaker and monix's one. Maybe a resilience4j integration module makes sense: I don't know the library, and hence I don't know how hard it is to integrate with it.

But in Akka and Monix's case, you wrap any => Future[T]/Task[T]. In our case this might be the result of request.send(). I think there's nothing specific in making http calls that would require special integration. So while having an out-of-the box circuit breakers etc. in sttp would be great, I fear this might be too specialised and generally a waste of code.

Btw. - same considerations apply to a retry backend / rate-limiting backend etc.

Either way we go, we should document how to create a circuit breaker / rate-limiter etc. :) And maybe the right way to approach this is to create resilience4s or extend monix-catnap (which already has the circuit breaker)?

@adamw
Copy link
Member Author

adamw commented Oct 23, 2019

Given that there's quite a lot of circuit breakers out there, and that integration with them is mostly trivial, we decided to document how to do that, instead of providing multiple integrations. See: https://sttp.readthedocs.io/en/latest/backends/custom.html#example-backend-with-circuit-breaker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants