Skip to content

Commit 240496b

Browse files
author
Matheus Vieira
committed
resolve conflict
2 parents d5cee99 + 7ce5ec9 commit 240496b

File tree

1 file changed

+0
-0
lines changed

1 file changed

+0
-0
lines changed

README.md

264 Bytes

Rate limiting refers to preventing the frequency of an operation from exceeding some constraint. In large-scale systems, rate limiting is commonly used to protect underlying services and resources.

Definition by: Google Cloud Architecture - Rate Limiting Strategies and Techniques

Definition by: Google Cloud Architecture

This project has been tested and confirmed to work with Java 6 and Java 8, but may also work with other versions of Java. However, these other versions have not been tested.

Instructions to use

  1. Add RateLimit class in your project.
  2. Create an instance of the RateLimit class and run the doFilter method around your HTTP endpoint.
 ... rateLimit = RateLimit.getInstance(); ... if (rateLimit.doFilter(request)) { json = "{\"message\": \"ok\"}"; response.setStatus(200); } else { json = "{\"message\": \"too many requests\"}"; response.setStatus(429); } 

For more details, see the example of the MyServlet class.

Contributing

If you want to contribute to this project, please follow the guidelines below:

0 commit comments

Comments
 (0)