I am trying to implement the retry logic or mechanism on micro-services to micro-services call. Basically, have to attempt retry 2 times if server is down only.
I tried to use @Retryable and @Recover to perform same but no luck. Instead I can thought of to use try-catch to catch particular exception when server is down, but I am not aware which exception will work and I can use it in try-catch to attempt retry 2 times when server is down.
Moreover, I checked and hence found for such cases there is ResourceAccessException
which basically made for when server is down but I am not sure.
Your help will be most appreciated. Please guide me here.