I have a spring managed bean of type B. I have @EnableREtry in a @Configuration class. When I use @Retryable on doStuff()
, the method gets retried on failure as
@Retryable
is implemented using Spring AOP.
Only external calls to retryable methods go through the proxy (which invokes the method within a RetryTemplate
); internal calls within the class bypass the proxy and therefore are not retried.
You can play some tricks to get a reference to the proxy from the application context and call that, or simply use a RetryTemplate
directly within your doStuff()
method.