mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Align default order between @EnableAsync and @EnableResilientMethods
Retries async methods with Future return types in non-reactive path. Closes gh-35643
This commit is contained in:
+4
-4
@@ -60,10 +60,10 @@ public @interface EnableResilientMethods {
|
||||
/**
|
||||
* Indicate the order in which the {@link RetryAnnotationBeanPostProcessor}
|
||||
* and {@link ConcurrencyLimitBeanPostProcessor} should be applied.
|
||||
* <p>The default is {@link Ordered#LOWEST_PRECEDENCE} in order to run
|
||||
* after all other post-processors, so that they can add advisors to
|
||||
* existing proxies rather than double-proxy.
|
||||
* <p>The default is {@link Ordered#LOWEST_PRECEDENCE - 1} in order to run
|
||||
* after all common post-processors, except for {@code @EnableAsync}.
|
||||
* @see org.springframework.scheduling.annotation.EnableAsync#order()
|
||||
*/
|
||||
int order() default Ordered.LOWEST_PRECEDENCE;
|
||||
int order() default Ordered.LOWEST_PRECEDENCE - 1;
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@
|
||||
package org.springframework.resilience.retry;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
@@ -77,7 +78,7 @@ public abstract class AbstractRetryInterceptor implements MethodInterceptor {
|
||||
return invocation.proceed();
|
||||
}
|
||||
|
||||
if (this.reactiveAdapterRegistry != null) {
|
||||
if (this.reactiveAdapterRegistry != null && !Future.class.isAssignableFrom(method.getReturnType())) {
|
||||
ReactiveAdapter adapter = this.reactiveAdapterRegistry.getAdapter(method.getReturnType());
|
||||
if (adapter != null) {
|
||||
Object result = invocation.proceed();
|
||||
|
||||
Reference in New Issue
Block a user