Spring boot execute second retry method after first retry method is successful

956 views Asked by At

I wanted to create two retry methods. Where in second retry method is async method. It should be hit only after successful completion of first method.

@Retryable(value = { LockedException.class }, maxAttempts = 3, backoff = @Backoff(delay = 1000))

Public String firstMethod() {    
    return "first";    
}

@Async
@Retryable(value = { LockedException.class }, maxAttempts = 3, backoff = @Backoff(delay = 1000))    
public String secondMethod() {    
    return "second";    
}

How would I do this?

0

There are 0 answers