Skip to content

abondar24/SpringRateLimitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring rate limitter

Small rate limitting library for rest controllers.

Idea: you can block your endpoints after some requests for specified period of time

Usage

  1. Add a depdendency to your maven project
         <dependency>
            <groupId>io.github.abondar24</groupId>
            <artifactId>SpringRateLimitter</artifactId>
            <version>0.0.2-SNAPSHOT</version>
         </dependency>
  1. Import RateConfig to your config or SpringBootApplication
@Import({RateConfig.class})
  1. Add property controller.package to your applicaiton.yml or application.properties
controller:
  package: package-name
  1. Add an exception handler for RateLimitException.

  2. Annotate controller or separate methods. Number of requests and period im milliseconds can be specified. Defalut values are 1000 requests and 1ms

Build

mvn clean install

Versions

  • 0.0.1 - basic rate limitter
  • 0.0.2 - added check for rate values

About

Dummy RateLimitter for SpringWeb

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages