REST API client library event handlers
The client library implements retry, fallback, circuit breaker, and timeout fault tolerance patterns.
The retry pattern enables dealing with communication errors that can be corrected by attempting them multiple times. The fallback pattern enables your service to continue the execution in case of a failed request to another service. The timeout pattern provides an upper bound to latency. See External configuration and Runtime configuration for details. The circuit breaker addresses the problem of accidental denial of service attacks due to retries and fast fallbacks in case of persisting communication errors.
The retry, fallback, and circuit breaker patterns are implemented using
the Resilience4j library and configured through the eventHandlers
configuration parameter. The timeout is implemented using OpenFeign library as a
timeout configuration parameter.
The configuration contains information about the associated events in the retry,
circuit breaker, and fallback patterns. The eventHandlers
configuration parameter is an array of eventHandlers that are applied to each
request.
