* Resolves #643, test cases failed due to presence of global state in CallsCount. Because AppTest was executed before B2BServiceTest, it scheduled 1 sec timer using ThrottleTimerImpl class. While resetting it used that global CallCount class reset() method, which reset all counters. So that causes thread safety issue because of unintended sharing of application state between test cases, which is not a good practice. * Updated class diagram png and added UCLS file
layout, title, folder, permalink, categories, tags
layout | title | folder | permalink | categories | tags | ||
---|---|---|---|---|---|---|---|
pattern | Throttling | throttling | /patterns/throttling/ | Behavioral |
|
Intent
Ensure that a given client is not able to access service resources more than the assigned limit.
Applicability
The Throttling pattern should be used:
- when a service access needs to be restricted to not have high impacts on the performance of the service.
- when multiple clients are consuming the same service resources and restriction has to be made according to the usage per client.