Throttle Service Ability in Spring

Is there a way to achieve service throttling capabilities for the rest of the services in Spring, especially when loading Spring.

Waiting here: My services are open to the outside world, there are currently no limits on the number of service calls per second / min. We want to control this by setting a throttle limit.

  • I have an alternative, tracking requests in a parallel hash map or any caching mechanism.

But more interested in Spring's way of looking at this. I know I can do it in node.js / scala

+11
source share
1 answer

There is a fairly new open source project that handles this:

https://github.com/weddini/spring-boot-throttling

A declarative approach to regulating control over Spring services. The @Throttling annotation helps you limit the number of call service methods for java.util.concurrent.TimeUnit to a specific user, IP address, HTTP header / cookie value, or using the Spring Expression Language (Spel).

+6
source

Source: https://habr.com/ru/post/1261617/


All Articles