-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
📝 [Proposal]: Add Retry/CircuitBreaker Feature in proxy middleware #3191
Comments
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
@gaby |
@lkeix I dont think we want to add failsafe-go to Fiber. We would just add the option for the user to implement their retry/sc mechanism. |
I believe we use the fasthttp client in the proxy. I wonder if it has some of these options built-in. Or if we could add them to our client and use that one instead. |
We have an addon for retry in Fiber codebase, which is also used by client -> https://github.com/gofiber/fiber/tree/main/addon/retry. I think we can use it and create new addon for circuit breaker |
Feature Proposal Description
Background
It seems Fiber is often used in micro-service architecture, the concern is network convergence in micro-service architecture.
The current Fiber proxy middleware lacks built-in retry and circuit breaker functionalities, which are essential for handling network failures and enhancing service reliability in microservice architectures. This proposal suggests adding
RetryFunc
andCircuitBreakerFunc
fields in the proxy configuration to enable these patterns.Fiber proxy will enhance services availability by built-in Retry/CircuitBreaker functionalities.
Abstract/Details
Add Retry/CircuitBreaker feature in proxy middleware.
This proposal involves adding two fields,
RetryFunc
andCircuitBreakerFunc
, to theConfig
structure of Fiber’s proxy middleware. These fields will allow users to define custom retry and circuit breaker logic, giving them flexibility in handling network failures.Below is a diff showing the proposed changes to the
Config
structure.Alignment with Express API
N/a
HTTP RFC Standards Compliance
Maybe related
API Stability
This change has no effect.
The added properties is set nil as default.
Proxy middleware do existing logic, when the added properties is nil.
This change completely maintain backward compatibility.
Feature Examples
Checklist:
The text was updated successfully, but these errors were encountered: