Hi Simone,
I agree. The way we control this is via a Semaphore on the application side (client side) that has permits equal to the maxRequestsQueuedPerDestination setting.
The send(..) API is only invoked in case this Semaphore has permits available, and any requests exceeding this parameter are blocked on the application side.
Also, we are making use of Response.CompleteListener for async requests which releases the acquired permit once the request response conversation has completed.
For sync requests we do not have any response Listener. We of course make use of the Semaphore to block any requests exceeding this parameter.
But, still, the moment this semaphore gives way to a request and we call the send() API, it implies that the request is queued up. And if the server is really busy processing other requests, there is a possibility that some of these requests, that have a timeout imposed, may timeout.
Our use case sends bulk requests in an asynchronous mode, with which I do not see any issues as there is no timeout associated with these requests. Just that there might be intermittent synchronous requests sent to the same client with a timeout imposed, that may timeout in case the server is really slow in processing the requests.
Thanks
Neha