I have a spring boot application and, I want to apply rate limits on some APIs which are integrated with 3rd party API for Payments that has rate limits. Basically a common pool for this external API, so that the API calls made to the 3rd party APIs don't exceed the rate limit.
I have gone through this link : https://medium.com/teamarimac/implementing-throttling-in-java-spring-boot-ec4723cfce9f.
In this link acquire()
method defines my actual requirement.
But I have my application running on AWS cloud
having multiple instances
. The method mentioned in the link applies on single instance only, but I want a solution which will work with all the instances combined
.
Thnaks