Commit Graph

353 Commits

Author SHA1 Message Date
abilan
7afbdddd10 Migrate building PRs to GitHub Action
See gh-345
2023-05-26 08:49:08 +02:00
Andreas Ahlenstorf
95464af8c2 Add TimeoutRetryPolicy(long timeout) ctor 2023-05-24 09:35:45 -04:00
Gary Russell
e6091f790c GH-340: Fix delayExpression w/ FixedBackOffPolicy
Resolves https://github.com/spring-projects/spring-retry/issues/340

Runtime evaluation of `delayExpression` with a `FixedBackOffPolicy`
was not implemented causing the expression to be ignored.
2023-05-17 11:37:06 -04:00
Spring Builds
cfa5550e9c Next development version (v2.0.2-SNAPSHOT) 2023-03-20 17:41:20 +00:00
Gary Russell
11489d1f15 Upgrade Spring Framework (6.0.7), aspectJ (1.9.19) 2023-03-20 10:52:49 -04:00
Phillip Webb
b9a2f94e78 Update CI pipeline 2023-03-09 12:55:59 -08:00
Ruslan Stelmachenko
a53dddc70b 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).
2023-03-08 14:14:34 -05:00
Yanming Zhou
debc4adc9f GH-22: Add @EnableRetry.order()
Fixes https://github.com/spring-projects/spring-retry/issues/22

Configure `@Retryable` before `@Transactional`, so we can handle transaction with stateless retries
2023-02-24 13:36:17 -05:00
Siva Kumar Edupuganti
0b37cc082e Added getting support links into README 2023-02-22 11:10:31 -05:00
tobi5775
864617f198 Add notice and license to jar
In many other Spring and Spring Boot projects, the license and notice files are included in the jar file under META-INF. 
In this Spring project, the two files should also be added to the jar.

* add notice and license to jar
* Update NOTICE.txt
2023-02-09 09:27:22 -05:00
abilan
4f61cd6928 Apply Java Format plugin for the latest code 2023-02-09 09:26:27 -05:00
jinliang.li
065c3091c4 GH-328: Fix RecoverAnnRH return types matching
Fixes https://github.com/spring-projects/spring-retry/issues/328

The loop in the `RecoverAnnotationRecoveryHandler.isParameterizedTypeAssignable`
only checks the first type argument of the `ParameterizedType` and returned.
When there are two type arguments, the result will be wrong.

* Fix `RecoverAnnotationRecoveryHandler.isParameterizedTypeAssignable` to continue matching
for next generic arguments
2023-02-08 12:54:15 -05:00
Henning Pöttker
87307292a5 Deprecate RetryListenSupport for default methods
Deprecate a `RetryListenerSupport` in favor of `default` methods in `RetryListener` interface
2022-11-28 16:57:01 -05:00
Henning Pöttker
61960f36e7 GH-324: Annotate @CircuitBreaker with @AliasFor
Fixes https://github.com/spring-projects/spring-retry/issues/324

Using the annotation `@CircuitBreaker` with Spring Framework 6 leads to the following warning:

```
 WARN org.springframework.core.annotation.AnnotationTypeMapping [main] : Support for convention-based annotation attribute overrides is deprecated and will be removed in Spring Framework 6.1. Please annotate the following attributes in @org.springframework.retry.annotation.CircuitBreaker with appropriate @AliasFor declarations: [include, maxAttempts, noRetryFor, maxAttemptsExpression, notRecoverable, exclude, exceptionExpression, label, retryFor]
```

* Provide a respective fix for `@CircuitBreaker` annotation.
* Deprecated attributes which are deprecated already in the `@Retriable`
2022-11-18 09:44:12 -05:00
Henning Poettker
0d7105805d Annotate @EnableRetry with @AliasFor 2022-11-17 12:18:27 -05:00
Spring Builds
34c04e7a47 Next development version (v2.0.1-SNAPSHOT) 2022-11-16 12:30:46 +00:00
Stephane Nicoll
df3fa24bb0 Upgrade to Spring Framework 6.0.0
Closes gh-321
2022-11-16 13:15:09 +01:00
Gary Russell
4eeab7d380 GH-319: Fix Javabean Setter Collision
Resolves https://github.com/spring-projects/spring-retry/issues/319

Regression: 47c1e52900

Multiple setters with different types.
2022-10-17 17:04:52 -04:00
Stephane Nicoll
c09c979852 Upgrade Java 17 version 2022-10-14 09:50:19 +02:00
Stephane Nicoll
aca23c1020 Upgrade Ubuntu version in CI image 2022-10-14 09:49:29 +02:00
Stephane Nicoll
c09959bf80 Upgrade to Spring Framework 6.0.0-RC1
Closes gh-318
2022-10-14 09:47:09 +02:00
gmedici
9df6272828 Some various simple fixes
* Fix `SimpleRetryPolicy` for NPE when `context.getLastThrowable()` is `null`
Set `NO_RECOVERY` if it cannot retry and that exception is null
* Fix `RecoverAnnotationRecoveryHandlerTests` for a proper return value
in the composite `recoverByComposedRetryableAnnotationName` annotation test
2022-10-13 11:55:31 -04:00
Stephane Nicoll
2d549990f4 Make sure build fails if a test fails 2022-10-13 11:18:13 +02:00
gmedici
9ffdd55cf2 Allow composing @Retryable annotation
* fix(Retryable): allow composing `Retryable` annotation  with recover argument annotated with @AliasFor by using `AnnotatedElementUtils.findMergedAnnotation` in `AnnotationAwareRetryOperationsInterceptor`

* Updated README.md with example and explanation for custom annotation composition with @Retryable

Added author and fix import style.

* Updated README.md removed version 2.0 mention on the Further customizations section
2022-10-05 10:47:43 -04:00
Stephane Nicoll
b08634d6bc Polish CI setup for milestones and RCs 2022-09-15 18:03:26 +02:00
Stephane Nicoll
1af8e3ac0d Adapt CI to release milestones and release candidates 2022-09-15 17:48:53 +02:00
Stephane Nicoll
df62b2248a Upgrade to Spring Framework 6.0.0-M6
Closes gh-310
2022-09-15 17:10:32 +02:00
Gary Russell
860bd0db4b GH-264: Enable Skipping Recovery
Resolves https://github.com/spring-projects/spring-retry/issues/264
2022-09-12 17:23:17 -04:00
Grzegorz Demecki
fef3cfe06d SimpleRetryPolicy Javadoc fix 2022-06-10 15:43:43 -04:00
Gary Russell
c02e546ea3 GH-299: Fix @Recover with Class Level @Retryable
Resolves https://github.com/spring-projects/spring-retry/issues/299

Caused by the fix for #244, recover methods should not be considered
as retryable, with class level annotation.

**cherry-pick to 1.3.x**
2022-05-18 13:21:28 -04:00
Gary Russell
47c1e52900 GH-184: Expression Evaluation at Runtime
Resolves https://github.com/spring-projects/spring-retry/issues/184

* Remove `args` property when using stateful (including CircuitBreaker).

Other polishing from review.

* Docs for stateful.
2022-05-04 15:21:29 -04:00
Nitin
7a86c9eb98 Update README.md 2022-04-25 13:51:57 -04:00
Gary Russell
0f5197a21c GH-293: Fix Bean Resolver for CBreaker Expressions
Resolves https://github.com/spring-projects/spring-retry/issues/293

**cherry-pick to 1.3.x**
2022-04-20 14:00:19 -04:00
Gary Russell
39880e4eb1 GH-288: More AssertJ Changes
Missed a few in the last commit.
2022-04-20 13:39:30 -04:00
Gary Russell
b577e29e4c GH-288: Change Tests to Use JUnit5 and AssertJ
Resolves https://github.com/spring-projects/spring-retry/issues/288

* Missed a few `assertEquals()`.
2022-04-20 12:55:23 -04:00
Gary Russell
aed39de54b GH-231: Support Retry Based on Result
Resolves https://github.com/spring-projects/spring-retry/issues/231

Enhance `RetryListener` to allow it to examine the result to determine
whether the call should be accepted, or retried according to the retry
policy.

* Restore missing period in doc.
2022-04-19 14:17:21 -04:00
Stephane Nicoll
d3fc55b06b Polish 2022-04-19 16:28:22 +02:00
Stephane Nicoll
8f8917c6e9 Merge pull request #286 from garyrussell
* pr/286:
  Polish contribution
  Switch to Java 17 on CI
  JDK17; Spring Framework 6.0.0-SNAPSHOT

Closes gh-286
2022-04-19 08:32:31 +02:00
Stephane Nicoll
68a4bd08ff Polish contribution
See gh-286
2022-04-19 08:32:21 +02:00
Gary Russell
3398f8feab Switch to Java 17 on CI
See gh-286
2022-04-19 08:31:25 +02:00
Gary Russell
b33671239b JDK17; Spring Framework 6.0.0-SNAPSHOT
Defer fetching RetryListener beans due to
`BeanCurrentlyInCreationException` with modern Spring Framework.

See gh-286
2022-04-19 08:31:25 +02:00
Gary Russell
4b3f8506a4 Replace EasyMock with Mockito
EasyMock was only used in one test.
2022-04-18 16:02:37 -04:00
Artem Bilan
ece15aa2a8 GH-285: Remove extra bean for service in README
Fixes https://github.com/spring-projects/spring-retry/issues/285
2022-04-18 09:32:29 -04:00
Stephane Nicoll
6eba459835 Polish 2022-04-15 16:53:22 +02:00
Stephane Nicoll
95183d7a37 Use modern java constructs 2022-04-15 16:46:55 +02:00
Stephane Nicoll
b70022971b Use method reference where possible 2022-04-15 16:41:28 +02:00
Stephane Nicoll
c9866e3785 Remove unnecessary boxing 2022-04-15 16:33:12 +02:00
Stephane Nicoll
59cc34fa6e Use diamond operator 2022-04-15 16:32:07 +02:00
Stephane Nicoll
ce18a874ed Polish 2022-04-15 16:23:32 +02:00
Stephane Nicoll
19ec4f87fb Upgrade to Mockito 4.4.0
Closes gh-284
2022-04-15 16:09:17 +02:00