Skip to content

About

Spring batch sequence job implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring batch sequence job implementation

Getting Started

Performing sequence of tasks with spring batch. Jobs are rely on loading csv files and can be started by rest endpoint.

Configuring sequence of jobs

TaskletStep step1 =
        stepBuilderFactory.get("ETL-file-read1").<User, User>chunk(100)
                .reader(userItemReader1)
                .processor(userItemProcessor)
                .writer(userItemWriter)
                .listener(decider)
                .build();

TaskletStep step2 =
        stepBuilderFactory.get("ETL-file-read2").<User, User>chunk(100)
                .reader(userItemReader2)
                .processor(userItemProcessor)
                .writer(userItemWriter)
                .listener(decider)
                .build();

return jobBuilderFactory.get("ETL-job").incrementer(new RunIdIncrementer())
        .start(step1)
        .next(decider).on(BatchStatus.FAILED.name()).end()
        .from(decider).on(BatchStatus.COMPLETED.name()).to(step2)
        .end()
        .build();

Reference Documentation

For further reference, please consider the following sections:

About

Spring batch sequence job implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages