🌐
GitHub
github.com › chrisgleissner › spring-batch-rest
GitHub - chrisgleissner/spring-batch-rest: REST API for Spring Batch using Spring Boot 2.2 · GitHub
REST API for Spring Batch using Spring Boot 2.2. Contribute to chrisgleissner/spring-batch-rest development by creating an account on GitHub.
Starred by 91 users
Forked by 44 users
Languages   Java 99.9% | Procfile 0.1%
🌐
GitHub
github.com › nicoraynaud › spring-batch-rest-api
GitHub - nicoraynaud/spring-batch-rest-api: Spring Boot library that exposes a REST API to manage Spring batch (start, stop, list, search jobs, job executions and history) · GitHub
swagger: '2.0' info: description: Spring Batch REST API endpoints documentation version: 0.1.0 title: Spring Batch REST API contact: {} license: {} host: localhost:8080 basePath: "/" tags: - name: jobs-resource description: Jobs Resource paths: "/management/jobs": get: tags: - jobs-resource summary: getJobs operationId: getJobsUsingGET produces: - "*/*" parameters: - name: jobName in: query description: jobName required: false type: string responses: '200': description: OK schema: type: array items: "$ref": "#/definitions/JobDescriptionDTO" '401': description: Unauthorized '403': description:
Starred by 6 users
Forked by 15 users
Languages   Java 99.7% | Shell 0.3%
🌐
GitHub
github.com › jmformenti › spring-batch-rest-cli-example
GitHub - jmformenti/spring-batch-rest-cli-example: Example of execution same spring batch job via command line or REST Api · GitHub
This is an example how you implement a Spring batch job once and execute it via command line or REST Api without any change in job source code.
Author   jmformenti
🌐
GitHub
github.com › pkainulainen › spring-batch-examples › blob › master › spring › src › main › java › net › petrikainulainen › springbatch › rest › in › RESTStudentReader.java
spring-batch-examples/spring/src/main/java/net/petrikainulainen/springbatch/rest/in/RESTStudentReader.java at master · pkainulainen/spring-batch-examples
import org.springframework.web.client.RestTemplate; · import java.util.Arrays; import java.util.List; · /** * This class demonstrates how we can read the input of our batch job from an · * external REST API. * * @author Petri Kainulainen · */ class RESTStudentReader implements ItemReader<StudentDTO> { ·
Author   pkainulainen
🌐
Petri Kainulainen
petrikainulainen.net › home › blog › spring batch tutorial: reading information from a rest api
Spring Batch Tutorial: Reading Information From a REST API - Petri Kainulainen
December 21, 2020 - If you want to read the input data of your batch job from a REST API, you can read this information by using the RestTemplate class. The next part of this tutorial describes how you can read the input data of your batch job from an Excel spreadsheet. P.S. You can get the example application ...
🌐
GitHub
github.com › chaitanyaankam › spring-batch-using-rest
GitHub - chaitanyaankam/spring-batch-using-rest: Spring Batch and Spring REST example; Batch controlled and monitored through REST API's exposed
Spring Batch and Spring REST example (Loading Data form CSV to Database using spring batch framework). Batch controlled and monitored through REST API's exposed (Starting, Aborting, Restarting and Monitoring).
Author   chaitanyaankam
🌐
GitHub
github.com › jehanzebqayyum › spring-batch-rest-client
GitHub - jehanzebqayyum/spring-batch-rest-client: spring batch rest client · GitHub
A spring boot app showcasing spring batch handling of multithreaded rest api calls.
Author   jehanzebqayyum
🌐
GitHub
github.com › officiallysingh › spring-boot-batch-web
GitHub - officiallysingh/spring-boot-batch-web: Spring batch job as Spring Rest service
Spring batch job as Spring Rest service. Contribute to officiallysingh/spring-boot-batch-web development by creating an account on GitHub.
Author   officiallysingh
🌐
Maven Repository
mvnrepository.com › artifact › com.github.chrisgleissner › spring-batch-rest-api
Maven Repository: com.github.chrisgleissner » spring-batch-rest-api
Home » com.github.chrisgleissner » spring-batch-rest-api · Spring Batch REST API · Central (20) Central · Atlassian External · Atlassian · WSO2 Releases · WSO2 Public · Hortonworks · Mulesoft · JCenter · KtorEAP · Sonatype · 2025 New · MacBook Pro M5 · 10-core · CPU · 10-core · GPU · 24GB · RAM · aar amazon android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle groovy io ios javascript jvm kotlin library maven mobile module npm osgi plugin resources rlang sdk server service spring sql starter testing tools ui war web webapp ·
Find elsewhere
🌐
GitHub
github.com › RawSanj › SpringRestBatch
GitHub - RawSanj/SpringRestBatch: Spring Boot-Batch project to read Movies from https://developers.themoviedb.org/3 REST API and store into database. · GitHub
Spring Boot-Batch project to read Movies from https://developers.themoviedb.org/3 REST API and store into database. - RawSanj/SpringRestBatch
Author   RawSanj
🌐
Baeldung
baeldung.com › home › spring › spring web › implement bulk and batch api in spring
Implement Bulk and Batch API in Spring | Baeldung
July 17, 2024 - We’ve also implemented a batch API that allows us to apply different operations to different resources. The batch API combined different sub-requests using the HttpMethod and relativeUrl along with the payload. The code backing this article is available on GitHub.
🌐
Javadoc.io
javadoc.io › doc › com.github.chrisgleissner › spring-batch-rest-api › latest › index.html
spring-batch-rest-api 1.5.1 javadoc (com.github.chrisgleissner)
Latest version of com.github.chrisgleissner:spring-batch-rest-api · https://javadoc.io/doc/com.github.chrisgleissner/spring-batch-rest-api · Current version 1.5.1 · https://javadoc.io/doc/com.github.chrisgleissner/spring-batch-rest-api/1.5.1 · package-list path (used for javadoc generation ...
🌐
Medium
shivaganesh01.medium.com › spring-batch-process-data-and-enrichment-involving-external-api-calls-performance-impact-f905f3c340f1
Spring Batch — Performance improvement while using External API Calls | by Shivaganesh | Medium
June 29, 2024 - In this article, we have discussed the ways to improve Spring Batch application performance improvement if there are external API calls are involved. Sample spring batch application with the above implementation can be found in the GitHub.
Top answer
1 of 2
2

You have to build job with JobbuilderFactory:

    @Configuration
@EnableBatchProcessing
public class BatchConfiguration {

    @Autowired
    public JobBuilderFactory jobBuilderFactory;

    @Autowired
    public StepBuilderFactory stepBuilderFactory;

    @Bean
    public SomeReader<Some> reader() {

        // some reader configuration
        return reader;
    }

    @Bean
    public SomeProcessor processor() {
        return new SomeProcessor();
    }

    @Bean
    public SomeWriter<Person> writer() {
        // some config
        return writer;
    }

    @Bean
    public Job someJob() {
        return jobBuilderFactory.get("someJob")
                .flow(step1())
                .end()
                .build();
    }

    @Bean
    public Step step1() {
        return stepBuilderFactory.get("step1")
                .<Some, Some> chunk(10)
                .reader(reader())
                .processor(processor())
                .writer(writer())
                .build();
    }
    }

Start job in rest controller:

@RestController
@AllArgsConstructor
@Slf4j
public class BatchStartController {

    JobLauncher jobLauncher;

    Job job;

    @GetMapping("/job")
    public void startJob() {
    //some parameters
        Map<String, JobParameter> parameters = new HashMap<>();
        JobExecution jobExecution = jobLauncher.run(job, new JobParameters(parameters));
        }    }

And one important detail - add in application.properties:

spring.batch.job.enabled=false

to prevent job self start.

2 of 2
0

Solved by myself, as suggested here: Spring Boot: Cannot access REST Controller on localhost (404)

@SpringBootApplication
@EnableBatchProcessing
@EnableScheduling
@ComponentScan(basePackageClasses = JobStatusApi.class)
public class UpdateInfoBatchApplication {
    
    public static void main(String[] args) {
        SpringApplication.run(UpdateInfoBatchApplication.class, args);
    }
    
}
🌐
dev history
coderhglee.github.io › blog › 2019 › 11 › 14 › rest-api-spring-batch
rest-api-spring-batch | dev history
December 27, 2019 - 평일 8시부터 18시까지 1분마다 API를 요청해 새로운 Data를 DB에 저장하고 뉴스 기사를 생성하는 Batch프로그램을 개발한다. 기존 사내 Batch는 단순 Thread로 구성되어있어서 상당히 코드가 ...
🌐
Medium
prateek-ashtikar512.medium.com › spring-batch-read-from-rest-api-990d03208c1
Spring Batch — read from REST API - Prateek
September 4, 2023 - class RESTStudentReader implements ItemReader<Student> { private static final Logger LOGGER = LoggerFactory.getLogger(RESTStudentReader.class); private final String apiUrl; private final RestTemplate restTemplate; private int nextStudentIndex; private List<Student> studentData; RESTStudentReader(String apiUrl, RestTemplate restTemplate) { this.apiUrl = apiUrl; this.restTemplate = restTemplate; nextStudentIndex = 0; } @Override public Student read() throws Exception { LOGGER.info("Reading the information of the next student"); if (studentDataIsNotInitialized()) { studentData = fetchStudentDataF
🌐
Baeldung
baeldung.com › home › spring › introduction to spring batch
Introduction to Spring Batch | Baeldung
December 24, 2024 - In this article, we learned how to work with Spring Batch and how to use it in a simple use case. We saw how we can easily develop our batch processing pipeline and how we can customize different stages in reading, processing, and writing. The code backing this article is available on GitHub.
🌐
BlackSlate
blackslate.io › articles › data-dump-using-spring-batch
Data dumping through REST API using Spring Batch
Most of the cloud services provide API to fetch their data. But data will be given as paginated results as returning the complete data will overshoot the response payload. To discover the complete list of books or e-courses or cloud machine ...
🌐
Medium
medium.com › @andrejtaneski › using-spring-batch-in-a-rest-api-application-493b812d80d1
Using Spring Batch in a REST API Application | by Andrej Taneski | Medium
March 24, 2023 - Spring Batch offers so much more than the example described in this post so be sure to refer to the official documentation. Here we looked at an example of how to define job steps, jobs and how to run jobs asynchronously from a REST controller. What you might want to do next is provide means for the users of the API ...