- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Closed as not planned
Labels
status: duplicateA duplicate of another issueA duplicate of another issue
Description
When a method is annotated by @Retryable, the interceptor does not use RetryListeners beans. The listeners are easy to plug in RetryTemplate but could also be considered by the interceptor
@SpringBootApplication
@EnableResilientMethods
public class EntryPoint {
    @Bean
    RetryListener retryListener(){
        return new RetryListener() {
            @Override
            public void beforeRetry(RetryPolicy retryPolicy, org.springframework.core.retry.Retryable<?> retryable) {
                System.out.println("...");
            }
            @Override
            public void onRetrySuccess(RetryPolicy retryPolicy, org.springframework.core.retry.Retryable<?> retryable, @Nullable Object result) {
                System.out.println("...");
            }
        };
    }
    public static void main(String[] args) {
        var ctx = SpringApplication.run(EntryPoint.class, args);
        ctx.getBean(A.class).foo();
    }
}
@Component
class A {
    private boolean b = true;
    @Retryable(includes = RuntimeException.class)
    public void foo(){
        if(b) {
            b = false;
            throw new RuntimeException();
        }
        System.out.println("ok");
    }
}Metadata
Metadata
Assignees
Labels
status: duplicateA duplicate of another issueA duplicate of another issue