I am using vert.x as a server to receive a search request which is then processed on the server to multiple outgoing HTTP requests to various external services.
For asynchronous behavior I have chosen to use RxJava using Vert.x native http client.
Thing is, the services I am using limit me to maximum 1 call per second.
What would be the best/simple way to throttle NIO HTTP outgoing requests?
In a single server a naive approach to solve your problem would be:
In a clustered way you could extend the previous concept and wrap it on an event bus address so it would be something like: