Skip to content

maoyi8212/spring-cloud-starter-zuul-ratelimit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Cloud Zuul RateLimit

Module to enable rate limit per service in Netflix Zuul.
There are four built-in rate limit approachs:

  • Authenticated User: Use the authenticated username or 'anonymous'
  • Request Origin: Use the user origin request
  • Authenticated User and Request Origin: Combine the authenticated user and the Request Origin
  • Global configuration per service: This one doesn't validate the request Origin or the Authenticated User
    • To use this approach just don't set param 'type'

Usage

This project is available on maven central

Add the dependency on pom.xml

<dependency>
    <groupId>com.marcosbarbero.cloud</groupId>
    <artifactId>spring-cloud-zuul-ratelimit</artifactId>
    <version>1.0.1.RELEASE</version>
</dependency>

Sample configuration

zuul:
  ratelimit:
    enabled: true #default false
    policies:
      myServiceId:
        limit: 10
        refresh-interval: 60 #default value (in seconds)
        type: #optional
          - user 
          - origin 

Any doubt open an issue.
Any fix send me a Pull Request.

About

Rate limit configuration for Spring Cloud Netflix Zuul

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%