Back-end/Spring-Batch
Jenkins - spring batch
prden
2024. 10. 7. 22:45
1. Jenkins와 Spring Batch
1) Jenkins의 스케쥴링 크론탭
- 다중 잡의 병렬처리 : jar을 동일 포트에서 여러개 병렬로 돌린다면 포트 중복이 일어날텐데 ?
- Setting server.port=0 effectively disables the HTTP listener in Spring Boot, which is generally unnecessary for Spring Batch jobs that run independently without a web interface.
- • Since Spring Batch jobs typically don’t require an HTTP server, this is a safe way to avoid port collisions while running multiple batch jobs concurrently.
- port = 0으로 할당하기
server.port=0
server.port=8081 (for one of the jobs, and different for the other if needed)
- 잡 내의 병렬처리 : 다중 스레드 스탭을 이용해 잡 나누기, 병렬 스텝을 통해 잡 나누기, 비동기 ItemProcessor/ItemWirter를 이용해 병렬 처리하기, 원격 청킹을 통해 Read -> RabitMQ -> Write, 파티셔닝을 통해 병렬처리하기
2)
3)