diff --git a/framework-docs/modules/ROOT/pages/core/resilience.adoc b/framework-docs/modules/ROOT/pages/core/resilience.adoc index 8313eb28350..a186c9c81ff 100644 --- a/framework-docs/modules/ROOT/pages/core/resilience.adoc +++ b/framework-docs/modules/ROOT/pages/core/resilience.adoc @@ -70,12 +70,12 @@ Or for 4 retry attempts and an exponential back-off strategy with a bit of jitte [source,java,indent=0,subs="verbatim,quotes"] ---- @Retryable( - includes = MessageDeliveryException.class, - maxRetries = 4, - delay = 100, - jitter = 10, - multiplier = 2, - maxDelay = 1000) + includes = MessageDeliveryException.class, + maxRetries = 4, + delay = 100, + jitter = 10, + multiplier = 2, + maxDelay = 1000) public void sendNotification() { this.jmsClient.destination("notifications").send(...); } @@ -324,7 +324,7 @@ outcome of all attempts: [source,java,indent=0,subs="verbatim,quotes"] ---- try { - var result = new RetryTemplate().execute(() -> { + var result = retryTemplate.execute(() -> { jmsClient.destination("notifications").send(...); return "result"; }); @@ -335,16 +335,21 @@ outcome of all attempts: ---- A {spring-framework-api}/core/retry/RetryListener.html[`RetryListener`] can be registered -with a `RetryTemplate` to react to events published during key retry phases (before a -retry attempt, after a retry attempt, etc.), being able to track all invocation attempts -and all exceptions coming out of the callback. This is particularly useful when using -`invoke` where no retry state other than the last original exception is exposed otherwise: +with a `RetryTemplate` to react to key retry steps (before or after a retry attempt etc.) +or simply to every invocation attempt, being able to track all exceptions coming out of +the callback and all retry outcomes (exhaustion, interruption, timeout). This is +particularly useful when using `invoke` where no retry state other than the last +original exception is exposed otherwise: [source,java,indent=0,subs="verbatim,quotes"] ---- var retryTemplate = new RetryTemplate(); - retryTemplate.setRetryPolicy(...); - retryTemplate.setRetryListener(...); + retryTemplate.setRetryListener(new RetryListener() { + @Override + public void onRetryableExecution(RetryPolicy retryPolicy, Retryable retryable, RetryState retryState) { + ... + } + }); retryTemplate.invoke( () -> jmsClient.destination("notifications").send(...)); diff --git a/framework-platform/framework-platform.gradle b/framework-platform/framework-platform.gradle index 5de9338424b..eb602f3c25e 100644 --- a/framework-platform/framework-platform.gradle +++ b/framework-platform/framework-platform.gradle @@ -8,9 +8,9 @@ javaPlatform { dependencies { api(platform("com.fasterxml.jackson:jackson-bom:2.21.2")) - api(platform("io.micrometer:micrometer-bom:1.16.4")) + api(platform("io.micrometer:micrometer-bom:1.16.5")) api(platform("io.netty:netty-bom:4.2.12.Final")) - api(platform("io.projectreactor:reactor-bom:2025.0.4")) + api(platform("io.projectreactor:reactor-bom:2025.0.5")) api(platform("io.rsocket:rsocket-bom:1.1.5")) api(platform("org.apache.groovy:groovy-bom:5.0.5")) api(platform("org.apache.logging.log4j:log4j-bom:2.25.4")) @@ -120,7 +120,7 @@ dependencies { api("org.glassfish:jakarta.el:4.0.2") api("org.graalvm.sdk:graal-sdk:22.3.1") api("org.hamcrest:hamcrest:3.0") - api("org.hibernate.orm:hibernate-core:7.3.0.Final") + api("org.hibernate.orm:hibernate-core:7.3.1.Final") api("org.hibernate.validator:hibernate-validator:9.1.0.Final") api("org.hsqldb:hsqldb:2.7.4") api("org.htmlunit:htmlunit:4.21.0")