spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.52k stars 3.32k forks source link

Redis rate limit with spring cloud gateway, limit by minutes, hours #2845

Open pradeepkumar-buku opened 1 year ago

pradeepkumar-buku commented 1 year ago
pradeepkumar-buku commented 1 year ago

Hi, Is there any way to implement a spring cloud gateway request rate limiter in such a way that it can rate-limit request in different time-units such as minutes, hours , days.

spencergibb commented 1 year ago

Not currently. It would be a whole new implementation on the redis side.

saurabh-slacklife commented 9 months ago

Good to have feature. For a workaround, below is what we have implemented in my org:

{ "replenishRate": "1", "burstCapacity": "600", "requestedTokens": "6" }

The above is close to 100 request per minute but is not exact due to implementation of Lua script.