I have a method on a service annotated with @Retryable
. If I call that method direct in a Controller the retry logic works. When I call that method indirectly through a wrapper method the retry logic does not get triggered.
public class SomeService{
// When calling this there is no retry
public void wrapper(){
isOn();
}
// Calling this direct the retry works
@Retryable(maxAttempts = 8)
public boolean isOn() {
System.out.println("Testing");
throw new RuntimeException("Failing");
}
}
I want to call the method with retry logic because there is a rather unstable endpoint that needs to be connected to. After that any errors would be valid and no retry is needed.
Is there a way to make sure the nested retry logic runs without having to retry the entire wrapping method?