From 9c4eadac8b723a0911e85c4de4fd2a95f2de9de2 Mon Sep 17 00:00:00 2001 From: Ruslan Stelmachenko Date: Wed, 8 Mar 2023 18:40:37 +0100 Subject: [PATCH] Change default order for @EnableRetry The new default order is `Ordered.LOWEST_PRECEDENCE - 1` to make sure the advice is applied before other advices with `Ordered.LOWEST_PRECEDENCE` order (e.g. an advice responsible for `@Transactional` behavior). --- .../retry/annotation/EnableRetry.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/springframework/retry/annotation/EnableRetry.java b/src/main/java/org/springframework/retry/annotation/EnableRetry.java index cb90a22f..d27f09a9 100644 --- a/src/main/java/org/springframework/retry/annotation/EnableRetry.java +++ b/src/main/java/org/springframework/retry/annotation/EnableRetry.java @@ -35,6 +35,7 @@ * * @author Dave Syer * @author Yanming Zhou + * @author Ruslan Stelmachenko * @since 1.1 * */ @@ -54,12 +55,13 @@ boolean proxyTargetClass() default false; /** - * Indicate the order in which the {@link RetryConfiguration} should be applied. + * Indicate the order in which the {@link RetryConfiguration} AOP advice should + * be applied. *

- * The default is {@link Ordered#LOWEST_PRECEDENCE} in order to run after all other - * post-processors, so that it can add an advisor to existing proxies rather than - * double-proxy. + * The default is {@code Ordered.LOWEST_PRECEDENCE - 1} in order to make sure the + * advice is applied before other advices with {@link Ordered#LOWEST_PRECEDENCE} order + * (e.g. an advice responsible for {@code @Transactional} behavior). */ - int order() default Ordered.LOWEST_PRECEDENCE; + int order() default Ordered.LOWEST_PRECEDENCE - 1; }