사용자 도구

사이트 도구


springframework:batch:multithread

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
springframework:batch:multithread [2022/01/19 14:33]
kwon37xi [Spring Batch Multi Thread]
springframework:batch:multithread [2023/01/03 14:45] (현재)
kwon37xi [Spring Batch Multi Thread]
줄 1: 줄 1:
 ====== Spring Batch Multi Thread ====== ====== Spring Batch Multi Thread ======
 +  * [[springframework:batch|Spring Framework Batch]]에서 ''throttleLimit''으로 멀티 쓰레드 실행.
   * 단순히 쓰레드 갯수를 늘리는 방식. partitioning 과는 다름.   * 단순히 쓰레드 갯수를 늘리는 방식. partitioning 과는 다름.
-  * reader와 writer 는 **thread safe**해야 한다. +  * reader와 writer 는 **thread safe**해야 한다. -> 즉, 공유 객체에 접근하지 말거나, ''synchronized''로 접근해야 한다. 
-  * 어느 쓰레드의 상태로 상태 저장을 할지 결정할 수 없으므로 **''saveState=false''** 로 지정해야만 한다. 상태 저장이 안되니 실패 지점 재시작도 불가하다.+    * Spring Batch 가 제공해주는 reader 는 thread safe 한 경우가 많다 
 +  * 어느 쓰레드의 상태로 상태 저장을 할지 결정할 수 없으므로 ''ItemReader''에 대해 **''saveState=false''** 로 지정해야만 한다. 상태 저장이 안되니 실패 지점 재시작도 불가하다.
   * ''taskExecutor()''와 ''throttleLimit()''을 지정한다.   * ''taskExecutor()''와 ''throttleLimit()''을 지정한다.
   * 보통 ThreadPool의 크기와 ''throtleLimit''은 동일하게 지정한다.   * 보통 ThreadPool의 크기와 ''throtleLimit''은 동일하게 지정한다.
springframework/batch/multithread.1642570439.txt.gz · 마지막으로 수정됨: 2022/01/19 14:33 저자 kwon37xi