@ -22,6 +22,8 @@ import java.util.concurrent.Future;
import org.aopalliance.intercept.MethodInterceptor ;
import org.aopalliance.intercept.MethodInterceptor ;
import org.aopalliance.intercept.MethodInvocation ;
import org.aopalliance.intercept.MethodInvocation ;
import org.apache.commons.logging.Log ;
import org.apache.commons.logging.LogFactory ;
import org.jspecify.annotations.Nullable ;
import org.jspecify.annotations.Nullable ;
import org.reactivestreams.Publisher ;
import org.reactivestreams.Publisher ;
import reactor.core.publisher.Flux ;
import reactor.core.publisher.Flux ;
@ -50,6 +52,8 @@ import org.springframework.util.ClassUtils;
* /
* /
public abstract class AbstractRetryInterceptor implements MethodInterceptor {
public abstract class AbstractRetryInterceptor implements MethodInterceptor {
private static final Log logger = LogFactory . getLog ( AbstractRetryInterceptor . class ) ;
/ * *
/ * *
* Reactive Streams API present on the classpath ?
* Reactive Streams API present on the classpath ?
* /
* /
@ -102,6 +106,7 @@ public abstract class AbstractRetryInterceptor implements MethodInterceptor {
. maxDelay ( spec . maxDelay ( ) )
. maxDelay ( spec . maxDelay ( ) )
. build ( ) ;
. build ( ) ;
RetryTemplate retryTemplate = new RetryTemplate ( retryPolicy ) ;
RetryTemplate retryTemplate = new RetryTemplate ( retryPolicy ) ;
String methodName = ClassUtils . getQualifiedMethodName ( method , ( target ! = null ? target . getClass ( ) : null ) ) ;
try {
try {
return retryTemplate . execute ( new Retryable < @Nullable Object > ( ) {
return retryTemplate . execute ( new Retryable < @Nullable Object > ( ) {
@ -112,11 +117,14 @@ public abstract class AbstractRetryInterceptor implements MethodInterceptor {
}
}
@Override
@Override
public String getName ( ) {
public String getName ( ) {
return ClassUtils . getQualifiedMethodName ( method , ( target ! = null ? target . getClass ( ) : null ) ) ;
return methodName ;
}
}
} ) ;
} ) ;
}
}
catch ( RetryException ex ) {
catch ( RetryException ex ) {
if ( logger . isDebugEnabled ( ) ) {
logger . debug ( "@Retryable operation '%s' failed" . formatted ( methodName ) , ex ) ;
}
throw ex . getCause ( ) ;
throw ex . getCause ( ) ;
}
}
}
}