Class ErrorsPerIntervalWithBlacklistTimeStrategy

java.lang.Object
org.distributeme.core.routing.blacklisting.intervalbased.withblacklistingtimeout.ErrorsPerIntervalWithBlacklistTimeStrategy
All Implemented Interfaces:
BlacklistingStrategy

public class ErrorsPerIntervalWithBlacklistTimeStrategy extends Object implements BlacklistingStrategy
A service instance is blacklisted after x successive intervals of length y, in which z failures occur. The blacklisting condition is fullfilled as soon as the error count is reached within the current interval. After blacklisting b seconds the service instance is going to be whitelisted again. During b no further error checks are done. After whitelisting, the error detection starts again. b=20, x=2, y=10, z=1

 0-----4------10-------16-----20------------30------36-----40(Seconds)->
       ^               ^                            ^
       |               |----------------------------|
     Error        Error ->  Blacklisted           Whitelisted again
 
b, x, y and z are configurable via configureme. b: blacklistTime x: requiredNumberOfIntervalsWithErrors y: intervalDurationInSeconds z: errorsPerIntervalThreshold If no valid configuration is given, then getDecision() always returns false.
Author:
rboehling