Skip to content

GH-2427: Allow RuntimeException to be Classified #2458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

garyrussell
Copy link
Contributor

Resolves #2457

Previously, classifying RuntimeException either for no retries or for blocking retries would cause undesirable effects - its classification would be found first because the classifier first traverses up the class hierarchy to find a match before traversing down the cause links.

When classifying exception for retry, unwrap the 'LEFE' cause from a TimestampedException and/or ListenerExecutionFailedException so that the classification is made on that cause.

By default, the retry classifier has no classified exceptions when used in "classify for retry" mode (instead of the default "classify for no retry" mode). This means that, if retryOn(RuntimeException.class) is used, then all RuntimeExceptions will be retried (including those that are usually considered fatal).

With mixed blocking/non-blocking retries, change the behavior to include the standard fatal exceptions in case the user configures all RuntimeExceptions to use blocking retries.

Also tested with a Boot app to see that a conversion exception bypasses all retries and goes straight to the DLT.

Resolves spring-projects#2457

Previously, classifying `RuntimeException` either for no retries or for
blocking retries would cause undesirable effects - its classification
would be found first because the classifier first traverses up the
class hierarchy to find a match before traversing down the cause links.

When classifying exception for retry, unwrap the 'LEFE' cause from a
`TimestampedException` and/or `ListenerExecutionFailedException` so
that the classification is made on that cause.

By default, the retry classifier has no classified exceptions when
used in "classify for retry" mode (instead of the default "classify
for no retry" mode). This means that, if `retryOn(RuntimeException.class)`
is used, then all `RuntimeException`s will be retried (including those
that are usually considered fatal).

With mixed blocking/non-blocking retries, change the behavior to include
the standard fatal exceptions in case the user configures all `RuntimeException`s
to use blocking retries.

Also tested with a Boot app to see that a conversion exception bypasses
all retries and goes straight to the DLT.
@artembilan artembilan merged commit 97ed09e into spring-projects:main Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal exceptions in Combining Blocking and Non-Blocking Retries
2 participants