spring-cloud / spring-cloud/spring-cloud-gateway

Provide Quota Filter based on redis

Open
#1,402 5 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting for votes
Dominant language
Java
Stars
4.9k
Forks
3.5k
Avg merge
20h 57m
Merged PRs (30d)
8

Description

Hey there,

what do you think of a new quota filter (based on redis) where you can use a limit and different period "units" like: "second","minute","day","month","year","abs"

filters:
   - name: RequestQuotaFilter
      args:
         key-resolver: "principalNameKeyResolver"
         redis-quota-filter:
         limit: 10
        period: "DAY"

With a quota filter it would be easy to create one click urls, api-key urls or some other things.
Filter will give you the possibility to limited a quota with periods you really need.

Currently you can only limit a quote by using the rate limiter where you can't setup a fine-grained quota (because the filter is not for setting up a quota check 😀).

So if you like the idea, i would like to implement the new Filter that can handle specific quotas for routes / service.
To use it in a more generic way you can add your custom key-resolver (like the rate limiter).

What do you think?

If you like it, I can bring that feature / filter in.

Kind regards

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing rate limiter filter and its custom key-resolver behavior, then determine how a Redis-backed quota filter would fit route and service configuration. Done should include agreed semantics for the second, minute, day, month, year, and absolute periods, plus configuration and coverage for quota enforcement.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.