I'm interested in finding out more about Spring Retry. Is there any documentation anywhere? All I can find is the source code in the GitHub project.
To enable spring-retry we need to put one annotation in the Spring Boot Application class. So open SpringRetryApplication class and add @EnableRetry in class level.
Spring Retry provides an ability to automatically re-invoke a failed operation. This is helpful where the errors may be transient (like a momentary network glitch). In this tutorial, we'll see the various ways to use Spring Retry: annotations, RetryTemplate, and callbacks.
This class is thread-safe and suitable for concurrent access when executing operations and when performing configuration changes.
Spring Retry provides a circuit breaker implementation via a combination of it's CircuitBreakerRetryPolicy and a stateful retry. All circuit breakers created using Spring Retry will be created using the CircuitBreakerRetryPolicy and a DefaultRetryState .
However, whenever the execution of a retryable method fails with an exception, Spring will automatically retry to call the method up to three times. By default Spring uses a 1 second delay between method calls. Please note that the calling thread blocks during retry handling.
Spring Retry library (https://github.com/spring-projects/spring-retry) provides a declarative support to retry failed operations as well as fallback mechanism in case all the attempts fail.
Spring reference docs for Spring Retry are here: http://docs.spring.io/spring-retry/docs/api/current/
If you need the javadocs you can find them here: org.springframework.retry : spring-retry
Hope it helps, Nicolás
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With