본문 바로가기
study/SpringBatch

1. 스프링 배치 시작하기

by 금이패런츠 2022. 4. 29.
728x90
반응형
package com.example.springbatchtest;

import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@EnableBatchProcessing // 스프링 배치가 작동하기 위해 선언해야 하는 어노테이션 
@SpringBootApplication
public class SpringBatchTestApplication {

	public static void main(String[] args) {
		SpringApplication.run(SpringBatchTestApplication.class, args);
	}

}

@EnableBatchProcessing: 스프링배치가 작동하기 위해 선언해야 하는 어노테이션 

 

 

pom.xml- 아래 dependency 선언해야 사용가능. 

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-batch</artifactId>
		</dependency>

 

@EnableBatchProcessing 

->

SimpleBatchConfiguration: JobBuilderFactory, StepBuilderFactory 생성, 스프링 배치의 주요 구성 요소 생성. 

->

BatchConfigurerConfiguration

-> 

BatchAutoConfiguration: Job을 수행하는 JobLauncherApplicationRunner 빈 생성

728x90
반응형

'study > SpringBatch' 카테고리의 다른 글

2. 스프링 배치 DB 스키마 생성 (자동, 수동)  (0) 2022.04.29