obenplus.com | oben+ | Hikayesi bol bir yazılımcının kaleminden, teknoloji dünyasını en önemli ve en ince ayrıntısına kadar takip etmek, bir yazılımcının hayatını, yaşantısını gözlemlemek isteneyenler için...

All You Need For Retry Handling : Spring Retry

It is very common for apps to communicate each other. Most of the applications call Web Services or Rest APIs to communicate. While these processes goes on, world is sometimes very pitiless, temporarily faults may occur. These faults may be exampled as temporarily unreachable service, momentary loss of network connectivity or classic timeouts when service is busy.

When these problems happen, to reduce faults, there is a solution we can use : Spring-Retry

Spring Retry is very easy to use and flexible.

First, we add Spring-Retry dependency to our pom.xml

All you need to do ise adding the @Retryable annotation to your application.

For summary; Spring retry provides an easy way to add retry handling to spring applications. Retry handling can be added using annotations (@Retryable and @Recover).