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

Consider to have a middleware handler to handle service downgrade #1679

Open
GavinChenYan opened this issue Mar 27, 2023 · 1 comment
Open

Comments

@GavinChenYan
Copy link
Contributor

Consider to have a middleware handler to handle service downgrade for the following scenarios:

API server process unusual, return the unusual information to client directly (not reach the service logic)
API server process unusual, catch the request, return intermediate state to client (could be 3XX http status?) and try the request cache latter.
Found Congestion by monitoring, close core business service & business logic for the flood requests
database pressure, like too many connections request waiting ...,
...

Sometimes, we need the middleware handler return to client directly, sometimes we want to the middleware handler pass the situation parameters to service business handler (by audit info?)

@stevehu Can you please take a look?

@stevehu
Copy link
Contributor

stevehu commented Mar 27, 2023

It makes sense to provide a middleware handler just like the rate limit middleware handler. Instead of setting it up based on the number of requests, we need to detect certain conditions on the server to return some error code to block the requests to reach the business handlers.

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