Retry

2025. 10. 10. 18:50·Book/Spring Batch docs

❐ Retry


Retry
  • Batch 처리에서 일시적인 오류(transient error) 때문에 전체 작업이 실패하는 걸 방지하기 위해,
          자동 재시도(retry) 메커니즘을 제공한다.
  • 예를 들어 이런 경우에 유용하다.
    • 네트워크 일시 장애로 API 호출 실패
    • DB Deadlock 발생 (DeadlockLoserDataAccessException)
    • 외부 시스템 응답 지연
  • 실패 시 바로 중단하지 않고 일정 횟수까지 재시도 하는 방식으로 안정성을 높인다.

 

Retry 기능의 분리
  • Spring Batch 2.2.0 이후, Retry 기능은 별도의 라이브러리로 분리됐다.
    • 예전엔 RepeatTemplate 내부에서 Retry 로직을 직접 포함했지만
    • 지금은 Spring Retry가 RetryTemplate, BackOff, Policy 등을 담당하고,
    • Spring Batch는 단지 이를 통합해서 사용하는 구조예요.
  • 즉, Spring Batch의 내부 Retry 동작은 실제로 Spring Retry의 API를 기반으로 동작한다.

 

소스코드
// RetryOperations.java
public interface RetryOperations {...}
  
// BatchRetryTemplate.java
public class BatchRetryTemplate implements RetryOperations {...}

// FaultTolerantStepBuilder.java
public class FaultTolerantStepBuilder<I, O> extends SimpleStepBuilder<I, O> {...}

 

'Book > Spring Batch docs' 카테고리의 다른 글

Common Batch Patterns  (0) 2025.10.10
Scaling and Parallel Processing  (0) 2025.10.10
Item processing  (0) 2025.10.09
ItemReaders and ItemWriters  (0) 2025.10.07
Configuring a Step  (0) 2025.10.06
'Book/Spring Batch docs' 카테고리의 다른 글
  • Common Batch Patterns
  • Scaling and Parallel Processing
  • Item processing
  • ItemReaders and ItemWriters
gilbert9172
gilbert9172
gilbert9172 님의 블로그 입니다.
  • gilbert9172
    バックエンド
    gilbert9172
  • 전체
    오늘
    어제
    • All Categories (207)
      • 우테코 7기 (21)
        • 1주차 (8)
        • 2주차 (5)
        • 3주차 (6)
      • Langauge (6)
        • Java (3)
        • Kotlin (3)
      • Back-End (13)
        • SpringBoot (1)
        • Trouble Shooting (0)
        • Setup & Configuration (1)
        • SQL (3)
        • Redis (8)
      • Architecture (6)
        • Multi Module (1)
        • DDD (5)
      • CS (30)
        • Data Structure (6)
        • Operating System (0)
        • Network (12)
        • Database (10)
        • Design Pattern (2)
      • Algorithm (78)
        • 내용 정리 (18)
        • 문제풀이 (60)
      • DevOps (6)
        • AWS (5)
        • Git (1)
      • Front-End (1)
        • Trouble Shooting (1)
      • Project (6)
        • 페이스콕 (6)
      • Book (39)
        • 친절한 SQL 튜닝 (9)
        • 데이터 중심 애플리케이션 설계 (14)
        • 이벤트 기반 마이크로서비스 구축 (6)
        • Spring Batch docs (10)
        • Quartz docs (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    부분단조성
    Back-Tracking
    Two-Pointer
    greedy
    sliding-window
    오블완
    binarysearch
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.2
gilbert9172
Retry
상단으로

티스토리툴바