0
가능한 가장 간단한 재시도 시나리오를 시도했습니다. 재 시도는 실행시 무시됩니다.@Retryable이 실행되고 있지 않습니다.
Application.java :
이 서비스 클래스 내에@SpringBootApplication
@EnableRetry
public class Application extends SpringBootServletInitializer {
//...
: (같은 클래스 내에서) @Retryable
방법에
public Boolean processItem() {
Long id = 999L;
try {
retrieveItemWithRetry(id);
return true;
} catch (NoResultException e) {
return false;
}
}
@Retryable(include=NoResultException.class, backoff = @Backoff(delay = 500, maxDelay = 3000), maxAttempts = 5)
private void retrieveItemWithRetry(Long id) {
retrieveItem(id);
}
private OrderRequest retrieveItem(Long id) {
throw new NoResultException();
}
감사합니다. @Gary, 레코드의 경우'@ Retryable '클래스가 호출 클래스에 삽입 된'@ Component'인지 확인해야했습니다. –