Skip to content

Commit a53dddc

Browse files
authored
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).
1 parent debc4ad commit a53dddc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/org/springframework/retry/annotation/EnableRetry.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
*
3636
* @author Dave Syer
3737
* @author Yanming Zhou
38+
* @author Ruslan Stelmachenko
3839
* @since 1.1
3940
*
4041
*/
@@ -54,12 +55,13 @@
5455
boolean proxyTargetClass() default false;
5556

5657
/**
57-
* Indicate the order in which the {@link RetryConfiguration} should be applied.
58+
* Indicate the order in which the {@link RetryConfiguration} AOP <b>advice</b> should
59+
* be applied.
5860
* <p>
59-
* The default is {@link Ordered#LOWEST_PRECEDENCE} in order to run after all other
60-
* post-processors, so that it can add an advisor to existing proxies rather than
61-
* double-proxy.
61+
* The default is {@code Ordered.LOWEST_PRECEDENCE - 1} in order to make sure the
62+
* advice is applied before other advices with {@link Ordered#LOWEST_PRECEDENCE} order
63+
* (e.g. an advice responsible for {@code @Transactional} behavior).
6264
*/
63-
int order() default Ordered.LOWEST_PRECEDENCE;
65+
int order() default Ordered.LOWEST_PRECEDENCE - 1;
6466

6567
}

0 commit comments

Comments
 (0)