GH-2427: Allow RuntimeException to be Classified #2458
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/orListenerExecutionFailedException
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 allRuntimeException
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.