Skip to content
Advertisement

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.

JavaScript

Advertisement

Answer

You can use the include parameter of the annotation to handle multiple various exceptions:

JavaScript
Advertisement