Skip to content

Example repo for Rate Limiter using Spring Cloud Gateway

Notifications You must be signed in to change notification settings

TechPrimers/ratelimiter-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rate Limiter using Spring Cloud Gateway

Architecture

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

About

Example repo for Rate Limiter using Spring Cloud Gateway

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages