- 
                Notifications
    
You must be signed in to change notification settings  - Fork 38.8k
 
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
Overview
Spring Framework 7.0.0-M9
Spring Retry's RetryTemplateBuilder has a traversingCauses() option, allowing setups like this:
new RetryTemplateBuilder()
   .retryOn(IOException.class)
   .traversingCauses()
   .build();This is handy for scenarios where I don't really care about the top-level exception being thrown, but I want to retry if an underlying cause is an IOException, for example.
The new support in Framework doesn't really have an equivalent here.
While I can supply my own exception predicate to the RetryPolicy and check the root cause myself, I wouldn't be able to use the convenient includes() and excludes() configurations for that.
Proposal
Please consider adding that feature, allowing me to do something like this:
new RetryTemplate(RetryPolicy.builder()
   .includes(Foo.class)
   .excludes(Bar.class)
   .traversingCauses()
   .build());The annotation-based equivalent would be:
@Retryable(includes = Foo.class, excludes = Bar.class, traversingCauses = true)Related Issues
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement