사용자 도구

사이트 도구


springframework:batch

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
springframework:batch [2019/12/03 14:10]
kwon37xi
springframework:batch [2022/10/14 12:27]
kwon37xi [Java Config Spring Bean 설정시 리턴 타입을 인터페이스가 아닌 구현 클래스로 지정할 것.]
줄 44: 줄 44:
  
 ===== Transaction 설정 ===== ===== Transaction 설정 =====
 +==== Connection Pool 설정 ====
 +  * batch job 이 job 단위로 단독 프로세스로 실행되는 경우
 +  * batch job 은 실제로 Parallel 로 실행되는게 아니면 DB 커넥션이 1~2개 정도 밖에 필요하지 않다.
 +  * parallel, async 실행에 대비해서 maximum connection 갯수는 충분한 숫자로 하되,
 +  * minimum 갯수를 5개 혹은 그 이하로 지정해야 Batch job 이 실행 될 때마다 커넥션을 과도하게 맺느라 들어가는 실행시간 지연 문제를 해소하고, 불필요하게 DB connection 을 점유하여 DB 자체의 한계에 봉착하는 문제를 피할 수 있다.
 +
 ==== 트랜잭션 매니저를 지정하지 않으면 ==== ==== 트랜잭션 매니저를 지정하지 않으면 ====
 TransactionManager를 지정하지 않으면 다음과 같은 오류가 발생한다. TransactionManager를 지정하지 않으면 다음과 같은 오류가 발생한다.
줄 129: 줄 135:
  
 > o.s.b.c.l.AbstractListenerFactoryBean    : org.springframework.batch.item.ItemReader is an interface.  The implementing class will not be queried for annotation based listener configurations.  If using @StepScope on a @Bean method, be sure to return the implementing class so listner annotations can be used. > o.s.b.c.l.AbstractListenerFactoryBean    : org.springframework.batch.item.ItemReader is an interface.  The implementing class will not be queried for annotation based listener configurations.  If using @StepScope on a @Bean method, be sure to return the implementing class so listner annotations can be used.
 +> org.springframework.batch.item.ItemReader는 인터페이스입니다. 구현 클래스는 어노테이션 기반 listner 구성에 대해 실행되지 않습니다. @Bean 메소드에서 @StepScope를 사용하는 경우 listner 어노테이션을 사용할 수 있도록 구현 클래스를 리턴해야합니다.
 +
 +
  
  
줄 177: 줄 186:
   * [[https://examples.javacodegeeks.com/enterprise-java/spring/batch/spring-batch-exception-handling-example/|Spring Batch Exception Handling Example | Examples Java Code Geeks - 2018]]   * [[https://examples.javacodegeeks.com/enterprise-java/spring/batch/spring-batch-exception-handling-example/|Spring Batch Exception Handling Example | Examples Java Code Geeks - 2018]]
   * [[http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:rte2:brte:batch_core:parallel_process|egovframework:rte2:brte:batch_core:parallel_process [eGovFrame]]]   * [[http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:rte2:brte:batch_core:parallel_process|egovframework:rte2:brte:batch_core:parallel_process [eGovFrame]]]
 +  * [[https://www.baeldung.com/spring-batch-conditional-flow|Conditional Flow in Spring Batch | Baeldung]]
springframework/batch.txt · 마지막으로 수정됨: 2023/12/08 13:43 저자 kwon37xi