JAVA-18602: update spring-retry version (#13637)

* java-18602 update spring-retry version

* java-18602 spring-scheduling, improve test coverage

* Replace usage of deprecated function in springframework-util with apache-common-lang library
This commit is contained in:
3hsan
2023-03-24 07:15:13 +01:00
committed by GitHub
parent 2fbe46bc19
commit e9d61ee8f7
5 changed files with 17 additions and 7 deletions

View File

@@ -2,7 +2,6 @@ package com.baeldung.springretry;
import java.sql.SQLException;
import org.springframework.context.annotation.PropertySource;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Recover;
import org.springframework.retry.annotation.Retryable;
@@ -13,13 +12,13 @@ public interface MyService {
@Retryable
void retryService();
@Retryable(value = SQLException.class)
@Retryable(retryFor = SQLException.class)
void retryServiceWithRecovery(String sql) throws SQLException;
@Retryable(value = { SQLException.class }, maxAttempts = 2, backoff = @Backoff(delay = 100))
@Retryable(retryFor = SQLException.class , maxAttempts = 2, backoff = @Backoff(delay = 100))
void retryServiceWithCustomization(String sql) throws SQLException;
@Retryable( value = SQLException.class, maxAttemptsExpression = "${retry.maxAttempts}",
@Retryable(retryFor = SQLException.class, maxAttemptsExpression = "${retry.maxAttempts}",
backoff = @Backoff(delayExpression = "${retry.maxDelay}"))
void retryServiceWithExternalConfiguration(String sql) throws SQLException;