spring-cloud / spring-cloud/spring-cloud-gateway
Provide Quota Filter based on redis
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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