Files
spring-boot-rest/spring-scheduling/src/main/java/com/baeldung/springretry/MyService.java
3hsan e9d61ee8f7 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
2023-03-24 11:45:13 +05:30

30 lines
937 B
Java

package com.baeldung.springretry;
import java.sql.SQLException;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Recover;
import org.springframework.retry.annotation.Retryable;
public interface MyService {
@Retryable
void retryService();
@Retryable(retryFor = SQLException.class)
void retryServiceWithRecovery(String sql) throws SQLException;
@Retryable(retryFor = SQLException.class , maxAttempts = 2, backoff = @Backoff(delay = 100))
void retryServiceWithCustomization(String sql) throws SQLException;
@Retryable(retryFor = SQLException.class, maxAttemptsExpression = "${retry.maxAttempts}",
backoff = @Backoff(delayExpression = "${retry.maxDelay}"))
void retryServiceWithExternalConfiguration(String sql) throws SQLException;
@Recover
void recover(SQLException e, String sql);
void templateRetryService();
}