It is just a opinion or suggestion to use Spring-retry
(what i do in my case).
- Recovery
- backoff Policy.
- retry Count.
Spring-retry
enables user to define multiple retry method against different exception raised.
You should handle those exception accordingly.. like if a method having some severe exception then whether you should try or not (you should decide)..
Suggestion ::The @Recover
annotation is used to define a separate recovery method when a @Retryable
method fails with a specified exception. You may store thing in database to process it further..
@Recover
void recover(SQLException e, String sql){ // Your Code of Handling...}
Now if you know that raised exception is able to handle in next retry then you should apply BackOff
Policy. so that this can be handle accordingly..