Background#
Imagine that you have developed any Servlet-based web application and want to restrict access for each IP. You want to apply the same restriction to each IP - 30 requests per minute.
This article demonstrates using Bucket4j.
Create Project#
Add Dependencies#
Add the following dependencies to pom.xml
:
<dependency>
<groupId>com.giffing.bucket4j.spring.boot.starter</groupId>
<artifactId>bucket4j-spring-boot-starter</artifactId>
<version>0.12.2</version>
</dependency>
Got something to do, will come back to it later.