-
Notifications
You must be signed in to change notification settings - Fork 534
Closed
Description
I just answered a question on StackOverflow, please read for more details and my analysis:
https://stackoverflow.com/a/67831919/1082681
The original poster of the question also published this reproducer which helped me find the root cause:
https://github.com/Nikhilgupta1891/RetryRecover
In a nutshell, Spring AOP cannot intercept the execution of a @Recover method because of invocation.getThis() instead of invocation.getProxy() here:
Lines 159 to 168 in e637911
| @Override | |
| public Object invoke(MethodInvocation invocation) throws Throwable { | |
| MethodInterceptor delegate = getDelegate(invocation.getThis(), invocation.getMethod()); | |
| if (delegate != null) { | |
| return delegate.invoke(invocation); | |
| } | |
| else { | |
| return invocation.proceed(); | |
| } | |
| } |
If there is no compelling reason to use the target object instead of its corresponding proxy (if any exists), please change it accordingly.
Metadata
Metadata
Assignees
Labels
No labels