Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ztrzaska/spring-batch-file-handler
Spring batch sequence job implementation
https://github.com/ztrzaska/spring-batch-file-handler
spring-batch spring-batch-jobs spring-boot
Last synced: about 1 month ago
JSON representation
Spring batch sequence job implementation
- Host: GitHub
- URL: https://github.com/ztrzaska/spring-batch-file-handler
- Owner: ztrzaska
- Created: 2021-01-01T14:02:13.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-15T14:43:21.000Z (over 2 years ago)
- Last Synced: 2023-07-26T12:33:39.024Z (over 1 year ago)
- Topics: spring-batch, spring-batch-jobs, spring-boot
- Language: Java
- Homepage:
- Size: 55.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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").chunk(100)
.reader(userItemReader1)
.processor(userItemProcessor)
.writer(userItemWriter)
.listener(decider)
.build();TaskletStep step2 =
stepBuilderFactory.get("ETL-file-read2").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:* [Spring batch documentation](https://docs.spring.io/spring-batch/docs/current/reference/html/)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.7.0/maven-plugin/reference/html/)
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.7.0/reference/htmlsingle/#data.sql.jpa-and-spring-data)