====== Spring Batch Multi Thread ====== * [[springframework:batch|Spring Framework Batch]]에서 ''throttleLimit''으로 멀티 쓰레드 실행. * 단순히 쓰레드 갯수를 늘리는 방식. partitioning 과는 다름. * reader와 writer 는 **thread safe**해야 한다. -> 즉, 공유 객체에 접근하지 말거나, ''synchronized''로 접근해야 한다. * Spring Batch 가 제공해주는 reader 는 thread safe 한 경우가 많다 * 어느 쓰레드의 상태로 상태 저장을 할지 결정할 수 없으므로 ''ItemReader''에 대해 **''saveState=false''** 로 지정해야만 한다. 상태 저장이 안되니 실패 지점 재시작도 불가하다. * ''taskExecutor()''와 ''throttleLimit()''을 지정한다. * 보통 ThreadPool의 크기와 ''throtleLimit''은 동일하게 지정한다. ===== 참조 ===== * [[https://jojoldu.tistory.com/493|Spring Batch에서 Multithread로 Step 실행하기]]