Narendra Pathai 922fd62da6 Resolves #643, test cases failed due to global state in CallsCount (#803)
* 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
2018-10-21 21:14:07 +03:00
..
2017-09-13 20:39:31 +03:00

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Throttling throttling /patterns/throttling/ Behavioral
Java
Difficulty-Beginner

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.