I am using aop with spring boot 2.1.1, I have pointcut and advise to log calls and return values of methods annotated with custom annotation @LogAround
@Pointcut("@annotation(x.y.z.LogAround)")
public void logAroundJoinPoint() {}
@Before("logAroundJoinPoint()")
public void logBefore(JoinPoint joinPoint) {
// logging code
}
@AfterReturning(
pointcut = "logAroundJoinPoint()",
returning= "result")
public void logAfterReturning(JoinPoint joinPoint, Object result) {
//some logging code
}
This codes logs method calls as expected for methods annotated with @LogAround except when I use on method annotated with @Recover for spring retry!
I have no idea as why this is happening.
One option is to simple log withing the recover method but I would prefer if there is a way to make this work. Any help is appreciated.
I have setup demo code at git_demo_code