@Retryable not actually retrying
Since I have no @Configuration class in my project I tried creating an empty one just with @EnableRetry and @Configuration but it does not make my method use @Retryable so I have tried these two xml configurations instead
<context:annotation-config />
<aop:aspectj-autoproxy />
<bean class="org.springframework.retry.annotation.RetryConfiguration" />
and
<aop:config>
<aop:pointcut id="transactional"
expression="execution(* com..*MyCLass.myMethod(..))" />
<aop:advisor pointcut-ref="transactional"
advice-ref="retryAdvice" order="-1"/>
</aop:config>
<bean id="retryAdvice"
class="org.springframework.retry.interceptor.RetryOperationsInterceptor"/>
But again nothing will trigger my @Retryable method. Am I missing something? I'm using Spring 4.3.0 and I tried attaching @Retryable to both my interface (with @Service) and my implementation class along with @Component
Is there a way to dig deeper to see why my @Retryable gets skipped or whether @EnableRetry and the xml equivalent are actually doing something? I don't see any errors in my logs. It's just that the retry does not happen regardless of whether I try to configure spring-retry with xml or using annotations.
This happens while trying to weave aspects at runtime, should I weave at compile time?
How about creating a simple sample project? It's probably something simple, but hard to diagnose without running actual code.
There's nothing to stop you doing compile time weaving (or load time), but you don't have to do that to use @Retryable.
Is @Retryable supposed to work without a @Configuration class and just specify the aop config above in my xml?
I don’t remember ever doing it myself, but spring-retry is old enough that I expect I might have. How about that sample project?
I guess at least you need an AnnotationAwareRetryOperationsInterceptor? Someone else was asking about this in #191.
Just tested it with some simple XML config. Perhaps the original problem was fixed somehow in between. Will push my test as a fix for this issue soon enough...