Skip to content

Commit

Permalink
[fix] #123 JobScope추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeoongu committed Oct 10, 2024
1 parent 95ee0e5 commit 5f9c0e2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.batch.core.job.builder.JobBuilder;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.step.builder.StepBuilder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.PlatformTransactionManager;
Expand All @@ -16,13 +17,16 @@

@RequiredArgsConstructor
@Configuration
//@ConditionalOnProperty(name = "spring.batch.job.name", havingValue = "studentDataLoadJob")
public class FileItemReaderJobConfig {
private final CSVReader csvReader;
private final CSVWriter csvWriter;

@Bean
private static final String JOB_NAME = "studentDataLoadJob";

@Bean(JOB_NAME)
public Job studentDataLoadJob(JobRepository jobRepository, Step studentDataLoadStep) {
return new JobBuilder("studetnDataLoadJob", jobRepository)
return new JobBuilder(JOB_NAME, jobRepository)
.flow(studentDataLoadStep)
.end()
.build();
Expand Down

0 comments on commit 5f9c0e2

Please sign in to comment.