Skip to content

Questions regarding the Retry fault tolerance #2922

Answered by Ladicek
cj19 asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think there's a good way, frankly. It should be possible to add a second method that would have its own @Retry annotation, and call it from the first method. Something like:

@Retry(maxRetries = 3, retryOn = IllegalArgumentException.class)
public String hello() {
    return doHello();
}

@Retry(maxRetries = 10, retryOn = IllegalStateException.class)
String doHello() {
    ...
}

Note that this would only work in Quarkus, which supports self-interception.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@cj19
Comment options

@Ladicek
Comment options

Answer selected by cj19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants