I am trying to set up the rate-limiting in a spring cloud gateway.
I tried to configure the filter in the application.yaml as below
filters:
- name: RequestRateLimiter
args:
redis-rate-limiter.replenishRate: 1
redis-rate-limiter.burstCapacity: 5
I am getting the below error
java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name RequestRateLimiter
How to implement the rate limit in the spring cloud gateway?
One of the possibilities is not including the following dependency (the mistake which I did first time)
org.springframework.boot:spring-boot-starter-data-redis-reactive
Since the args
contain redis-rate-limiter
this dependency is must.
Below is a screenshot from the IDE showing RequestRateLimiterGatewayFilterFactory
getting added when the above dependency is included.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.