Uses of Class
com.shri.restinpeace.CircuitBreakerConfig.Builder
Packages that use CircuitBreakerConfig.Builder
-
Uses of CircuitBreakerConfig.Builder in com.shri.restinpeace
Methods in com.shri.restinpeace that return CircuitBreakerConfig.BuilderModifier and TypeMethodDescriptionstatic CircuitBreakerConfig.BuilderCircuitBreakerConfig.builder()Starts building a new config, defaulting to a count-based, 20-call window; a 50% failure-rate threshold, evaluated once at least 10 calls have been recorded; a 30-second open-state cooldown; 3 permitted half-open trial calls; and treating any 5xx response (or a transport failure) as a breaker failure.CircuitBreakerConfig.Builder.failureRateThreshold(int failureRateThreshold) Sets the failure-rate threshold that trips the breaker open.CircuitBreakerConfig.Builder.minimumNumberOfCalls(int minimumNumberOfCalls) Sets the minimum number of calls that must be in the window before a failure rate is ever evaluated, so the breaker never trips off a statistically meaningless sample (e.g. 1 failure out of 2 calls is technically 50%, but shouldn't trip a breaker tuned for a 20-call window).CircuitBreakerConfig.Builder.permittedCallsInHalfOpenState(int permittedCallsInHalfOpenState) Sets how many trial calls are let through while half-open, once the open-state cooldown elapses, before deciding whether to close (recovered) or re-open (still failing) based on their own failure rate.CircuitBreakerConfig.Builder.recordFailureForStatus(IntPredicate recordFailureForStatus) Sets which HTTP status codes count as a breaker failure - a genuine downstream failure (5xx, the default), not an application-level expected outcome (e.g. a404from an existence check, the same kind of outcome negative caching already treats as a valid answer rather than an error).CircuitBreakerConfig.Builder.slidingWindowSize(int size) Selects a count-based window ofsizecalls - the default shape.CircuitBreakerConfig.Builder.slidingWindowSize(Duration duration) Selects a time-based window of the lastduration- for a consumer who specifically wants "rate over the last N seconds regardless of call volume" rather than the count-based default.CircuitBreakerConfig.Builder.waitDurationInOpenState(Duration waitDurationInOpenState) Sets how long the breaker stays open before trialing recovery via a half-open state.