KresilCircuitBreakerPlugin
A plugin that enables the client to use the Kresil CircuitBreaker mechanism to prevent requests from being sent to a service that is likely to fail. Configuration can be done globally when installing the plugin.
Examples of usage:
// use predefined circuit breaker policies
install(KresilCircuitBreakerPlugin)
// use custom policies
install(KresilCircuitBreakerPlugin) {
failureRateThreshold = 0.5
slidingWindow(size = 100)
exponentialDelayInOpenState()
permittedNumberOfCallsInHalfOpenState = 5
maxWaitDurationInHalfOpenState = ZERO
recordFailureOnServerErrors()
}
Content copied to clipboard