Reputation: 576
We have three components(A,B and C). "A" sends data to "B" and "B" process data and post it to "C" using play WS. We have a situation when "C" is slow in processing the data, Time out happens in "B". But there is lot of data inward flow in "B" and keep posting it to "C" causes the whole system to run out of memory and finally crash. Is there a way to limit the number of WS request in "B" ? searched the play WS API but no luck. How should this be handled? Please suggest.
Upvotes: 2
Views: 988
Reputation: 1226
The problem is not about max connection number and not anything else api related. This problem is common in distributed systems and named "Fast producer and slow consumer". There is more solution then I could write here but a short list will be:
Edit: According to Documentation you can set a max. connection per host or total for client library, as I mentioned above the right way is improving architecture but this may also help and save the day. Also check reference.conf for all configuration options.
Upvotes: 1
Reputation: 8263
Consider Akka and some of throttling algorithms: http://letitcrash.com/post/28901663062/throttling-messages-in-akka-2
Upvotes: 0