492 Commits

Author SHA1 Message Date
Artem Bilan
c8977dda2d Next development version (v2.0.13-SNAPSHOT) 2025-05-16 11:06:14 -04:00
Artem Bilan
f4cd357e4a Upgrade test and dev dependencies; prepare for release 2025-05-16 10:47:17 -04:00
mando
a05e3a19c4 GH-352: Warning aboiut invalid values in ExponentialBackoffPolicy
- Add warning logs when setter values don't meet expected constraints
- Maintain backward compatibility by not changing behavior

Fixes #352

Signed-off-by: Kim Sumin <ksoomin25@gmail.com>
2025-05-16 10:09:23 -04:00
Artem Bilan
47a23591ff GH-491: Fix NPE in the MetricsRetryListener when label is null
Fixes: https://github.com/spring-projects/spring-retry/issues/491

The Micrometer tag cannot be with `null` value.
When `RetryCallback` does not provide a proper `getLabel()` implementation,
the `MetricsRetryListener` fails with a `NullPointerException`

* Fix `MetricsRetryListener.close()` to fallback to the `callback.getClass().getName()`
if `callback.getLabel() == null`
* Cover behavior in the new `RetryMetricsTests.labelFallbackToClassName()`
2025-05-08 15:20:26 -04:00
kimjunhyeong
936e720885 Fix proxy attribute name mismatch in RetryOperationsInterceptor
* Add tests for `RetryOperationsInterceptor` proxy attribute cleanup
* Add author to `RetryOperationsInterceptorTests`
* Remove unused import fail
* Fix `RetryOperationsInterceptorTests` extract `MethodInvocation` and simplify mocking

Signed-off-by: Kim Jun Hyeong <ggprgrkjh@naver.com>
2025-05-08 12:10:00 -04:00
Stéphane Nicoll
544b24e195 Upgrade to github-changelog-generator 0.0.12
Closes gh-489
2025-04-15 10:26:09 +02:00
Artem Bilan
91d96e736c Run spring-javaformat:apply 2025-03-27 14:59:04 -04:00
Artem Bilan
bded8e67df GH-488: Improve warning in the ExpressionRetryPolicy
Fixes: https://github.com/spring-projects/spring-retry/issues/488

When `@Retryable(exceptionExpression)` is used with SpEL template (`#{..}`),
a specific warning is emitted into logs indicating that such a syntax is deprecated.

* Improve that warning message pointing out what SpEL expression could be improved to
avoid this warning and future changes
2025-03-27 14:29:01 -04:00
Tran Ngoc Nhan
4f34e362b6 Fix some typos in the project
* Remove unused imports

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-03-14 12:50:53 -04:00
Artem Bilan
8918c36849 Migrate to DCO from CLA 2025-01-14 15:53:22 -05:00
Artem Bilan
9131e6a02a GH-480: Bring back POM revision property (#481)
Fixes: https://github.com/spring-projects/spring-retry/issues/480

* Add `flatten-maven-plugin` to resolve properties
and remove unnecessary build info from the final POM of the artifact to install/deploy

* Revert `version` extraction from POM via `sed` command in the build action
* Remove `flatten.clean` from the Maven Flatter Plugin, since `.flattened-pom.xml` generated file is landed in the `/target` dir
* Add `pomElements/profiles` for removal in the result `.flattened-pom.xml`
2025-01-01 18:35:39 -05:00
Artem Bilan
72a0d0e2e3 Fix actions\build to use mvn help:evaluate
Since there is no `revision` property in POM, we cannot use `sed` command to extract project version from the POM.

* Use more Maven-friendly `mvn help:evaluate -Dexpression="project.version" -q -DforceStdout` command to get the current project version
* Remove tentative `finish_release_tmp.yml` since `actions\build` has been fixed now
2024-12-13 12:46:53 -05:00
Artem Bilan
6cb5d7a61b Add tentative GHA WF to finish release 2024-12-13 12:32:54 -05:00
Artem Bilan
cef30d36ba Next development version (v2.0.12-SNAPSHOT) 2024-12-13 12:23:06 -05:00
Artem Bilan
c114574764 Upgrade dependencies, maven plugins; prepare for release
* Add `spotbugs-annotations` to avoid compiler warnings for missed classes
2024-12-13 11:38:39 -05:00
Artem Bilan
9c603ab338 Fix EnableRetryWithBackoffTests for possible random as 0 jitter
* Some other code style refactoring for better readability and AssertJ API usage
2024-12-13 11:09:47 -05:00
Artem Bilan
87f02c2f45 GH-474: Get rid of revision property in POM
Fixes: https://github.com/spring-projects/spring-retry/issues/474
2024-12-13 10:54:44 -05:00
Artem Bilan
3b650030d3 Add Announce Release in Chat job into release.yml 2024-12-13 10:51:45 -05:00
Artem Bilan
23f6a71302 GH-479: Fix pom.xml for proper org & project urls
Fixes: https://github.com/spring-projects/spring-retry/issues/479
2024-12-11 09:34:06 -05:00
Artem Bilan
f92c90a2a5 GH-477: Fix MetricsRetryListener.close() for concurrent calls
Fixes: https://github.com/spring-projects/spring-retry/issues/477

The `Timer.Builder` from Micrometer does not create a new `Builder` instance for its `tags()` call.
So, using shared `Timer.Builder` is not OK when it can be used from concurrent calls.

* Remove shared `retryMeterProvider` property and use fresh `Timer.Builder` instance in the `MetricsRetryListener.close()`
2024-11-22 10:17:59 -05:00
Artem Bilan
78bd8d22ea GH-476: Assemble Zip for Javadocs
Fixes: https://github.com/spring-projects/spring-retry/issues/476

* Add `maven-assembly-plugin` to Zip Javadocs from the `apidocs` dir into a `*-docs.zip` artifact
* Modify `build-and-deploy-snapshot.yml` and `release.yml` to assign `zip.deployed=false` attribute to Zip artifacts
* Also mark `docs.zip` files as `zip.type=docs`
2024-11-20 11:25:36 -05:00
Artem Bilan
ed9861d18a Next development version (v2.0.11-SNAPSHOT) 2024-10-18 13:04:16 -04:00
Artem Bilan
b74b0db4f6 Upgrade dependencies, Maven plugins; prepare for release 2024-10-18 12:48:30 -04:00
Artem Bilan
9120f9523f Add Revved up by Develocity badge into README.md 2024-10-16 16:42:59 -04:00
Artem Bilan
8f2a5a0ac5 Add Maven -Duser.name=spring-builds+github for Develocity 2024-10-16 16:30:50 -04:00
Artem Bilan
c85f87cd4e Upgrade to io.spring.develocity.conventions:develocity-conventions-maven-extension:0.0.22 2024-10-16 16:11:07 -04:00
Artem Bilan
50e7d82dc6 Add Develocity support to the project 2024-10-16 15:40:09 -04:00
Evgeny Lazarev
76b41e8dac Add AnnotationClassOrMethodPointcut.hashCode() impl
Due to the absence of a `hashCode()` implementation, proxies for the `AnnotationClassOrMethodPointcut` class are regenerated each time, 
which causes them to be stored in the `org.springframework.cglib.core.internal.LoadingCache` (with `RetryConfiguration.AnnotationClassOrMethodPointcut` being part of the composite key for this object).
This results in an excessive accumulation of generated proxies in memory, ultimately leading to metaspace overflow.
2024-09-23 14:15:16 -04:00
Tobias Soloschenko
4886b75d0b feat: setter for Log of RetryTemplate (#471)
GH-470: Add `RetryTemplate.setLogger()` to avoid reflection in other places

Fixes: #470
Issue link: https://github.com/spring-projects/spring-retry/issues/470

Spring Cloud Config does mutation in the `RetryTemplate` for its system loading logger via `RetryTemplateFactory`.

* Expose setter for `logger` property to avoid reflection.
* Add `RetryTemplateBuilder.withLogger()` for convenience
2024-09-19 11:24:41 -04:00
Artem Bilan
a34a62729d Adjust test logging for less noise during build
* Resolve deprecations in the `RetryContextSerializationTests`
2024-09-19 11:01:18 -04:00
Artem Bilan
b98b2a55a0 Next development version (v2.0.10-SNAPSHOT) 2024-09-13 16:17:42 -04:00
Artem Bilan
d0585fd6f7 Update test dependencies; prepare for release 2024-09-13 15:03:33 -04:00
Artem Bilan
dfc95fe42e GH-229: Expose method & methodArgs into ctx from RetryOperationsInterceptor
Fixes: #229
Issue link: https://github.com/spring-projects/spring-retry/issues/229

The logic in the target `RetryPolicy` might be based on the method and its arguments we retry.

* Expose `method` & `methodArgs` `RetryContext` attributes from an internal implementation
of the `MethodInvocationRetryCallback` in the `RetryOperationsInterceptor`
* Document these attributes
2024-09-13 11:07:08 -04:00
Artem Bilan
5493ab7edf GH-148: Test for @Retryable with an XML config
Fixes: #148
Issue link: https://github.com/spring-projects/spring-retry/issues/148
2024-09-12 12:12:26 -04:00
Artem Bilan
74b7ae2cbd Remove @Import(RetryConfiguration.class) from @Recover
Looks like that was a copy/paste artifact.
The `@Recover` is for business method purpose.
The `@Import(RetryConfiguration.class)` is done from the `@EnableRetry`
2024-09-12 11:55:54 -04:00
Artem Bilan
97ca28fc67 GH-188: Expose @CircuitBreaker(recover) attribute
Fixes: #188
Issue link: https://github.com/spring-projects/spring-retry/issues/188

All the logic to determine a recover method is there.
We are just missing the `CircuitBreaker(recover)` attribute with an `@AliasFor(annotation = Retryable.class)`
2024-09-12 10:49:29 -04:00
Artem Bilan
993526c9b8 Add GHA workflow to announce milestone planning in chat 2024-09-12 10:04:41 -04:00
Huijin Hong
42158baa44 GH-467: Support concurrent behavior on MetricsRetryListener
Fixes #467
2024-09-11 09:30:54 -04:00
LokeshAlamuri
c0a49411c2 GH-464: Fix backOff API in UniformRandomBackOffPolicy
Fixes: #464
Issue link: https://github.com/spring-projects/spring-retry/issues/464

When `maxBackOffPeriod` is less than `minBackOffPeriod`, delta is taken
taken as zero in `UniformRandomBackOffPolicy` `backOff()` method.

* Update tests to use `DummySleeper`
* Extract `UniformRandomBackOffPolicy` `backOffSuppliers` into local variables
* Modify `UniformRandomBackOffPolicy` tests
2024-09-09 10:00:03 -04:00
Spring Builds
db47bc66fd Next development version (v2.0.9-SNAPSHOT) 2024-08-16 13:22:40 -04:00
Artem Bilan
81a2cdd434 Downgrade to Micrometer 1.10.13
This is for compatibility with the Spring Framework `6.0.x` version we rely on so far
2024-08-16 12:09:02 -04:00
Stéphane Nicoll
8b8c3887ce Upgrade to Spring Framework 6.0.23
Closes gh-462
2024-08-16 15:25:14 +02:00
Artem Bilan
9d8df3b4d0 GH-458: Introduce MetricsRetryListener
Fixes: #458

* Fix code formatting violations

* * Make `retryContextToSample` as an `IdentityHashMap` and use `RetryContext` as a key
* Change `setCustomTags()` to the `@Nullable Iterable<Tag>` argument
* Use `exception = none` tag for successful executions to avoid time-series conflicts
2024-08-13 12:34:43 -04:00
Vicente Soriano
8e5cafe200 GH-460: Fix required Java version in README
Fixes: #460
2024-08-13 12:06:10 -04:00
Marcin Zajączkowski
9df8d6cc90 Add @Nullable in RetryContext to easier detect possible NPE
* Add @Nullable in RetryContext to easier detect possible NPE

Both getParent() and getLastThrowable() might return null, as mentioned
in javadoc. @Nullable helps an IDE warns developers about potential NPE.

* Rephrase Javadoc for RetryContext.getLastThrowable()

* Review fixes
2024-07-25 17:28:04 -04:00
Artem Bilan
a9b329af55 GH-456: Fix EnableRetryWithBackoffTests.randomExponential() for random
Fixes: #456

The random logic in the `ExponentialRandomBackOffPolicy` may end up with close to the `1`.
And after casting to `long` we got the same `1000`

* Fix test respectively to include that possibility.
2024-07-18 10:57:09 -04:00
Stéphane Nicoll
04f12a7d96 Remove concourse configuration 2024-07-14 10:48:23 +02:00
Stéphane Nicoll
ab1190dbf7 Fix CI badge in README to use GHA 2024-07-14 10:48:06 +02:00
Stéphane Nicoll
caa0d72d16 Fix formatting of Maven Central check url
Closes gh-455
2024-07-13 11:19:06 +02:00
Stéphane Nicoll
d09e100869 Next development version (v2.0.8-SNAPSHOT) 2024-07-13 11:14:43 +02:00