I am using spring-retry v1.3.1 with @Retryable annotation and I have a few questions on its behaviour. Let’s say that in my spring boot application I have a retry configuration that makes my application wait 1 hour before retrying. If my application is killed (for example by kubernetes) while it was wai…
Tag: spring-retry
Intellij – Spring Retry @Recover method marked as unused
When using Spring Retry @Recover method (which works ok) IntelliJ always marking method as unused and suggest to safe delete Method ‘recover(com.gth.common.exceptions.RetryableException, java.lang.String)’ is never used How can it be avoided? how can IntelliJ be aware of the recover method usage? …
Spring retry exception handling execution behavior
I am trying to get to the best way to wrap spring-retry @Retryable annotation around external service call. Here is my code: I have a few questions on what happens when a RestClientException occurs : Is the catch block executed before retry kicks in or does the retry kicks in before the catch block execution?…
@Retryable with @Scheduled don’t fire
I’ve written a Spring Boot Application where I’ve enabled Spring Batch Scheduling and Retriable as follow: I’ve defined a controller as follow: After 2 minutes, as the cron expression specified starts the job, so in the first step of it I’ll send it in exception so in the job execution…
Spring Retry – Exception problem and retries
How can we catch two different exceptions (ex. from .lang and .io packages) in the same block of @Retryable method. One, we return an IOException and the other we retry the method. Answer You can use the include parameter of the annotation to handle multiple various exceptions:
Spring Retryable – Async context
Have an issue with @Retryable in the Async context, I have a service call which is returning a SocketTimeOut exception. This I would have expected to retry 3 times, I do have @EnableRetry, however I am seeing something I little strange in the logs, a sleep interruptedException. Here is part of the stack trace…