Skip to content

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

Description

@GavinChenYan

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?

Activity

  1. stevehu commented on Mar 27, 2023

    @stevehu
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions