https://github.com/techprimers/ratelimiter-example
Example repo for Rate Limiter using Spring Cloud Gateway
https://github.com/techprimers/ratelimiter-example
Last synced: over 1 year ago
JSON representation
Example repo for Rate Limiter using Spring Cloud Gateway
- Host: GitHub
- URL: https://github.com/techprimers/ratelimiter-example
- Owner: TechPrimers
- Created: 2022-12-10T19:54:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-10T20:09:46.000Z (over 3 years ago)
- Last Synced: 2025-03-28T22:51:15.296Z (over 1 year ago)
- Language: Java
- Size: 92.8 KB
- Stars: 9
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rate Limiter using Spring Cloud Gateway
## Architecture

## Code Changes
The following config enables rate limiters and routes the traffic to backend instance which is a dropwizard app.
This app runs on `8082` port.
```
spring:
redis:
host: localhost
port: 6379
application:
name: ratelimiter-example
cloud:
gateway:
routes:
- id: route1
uri: http://localhost:8080/hello
predicates:
- Path=/hello
filters:
- name: RequestRateLimiter
args:
redis-rate-limiter.replenishRate: 20
redis-rate-limiter.burstCapacity: 40
redis-rate-limiter.requestedTokens: 1
```