Spring Batch Read File, Consume REST, Schedule Job | Spring Boot 3, Spring Batch, Scheduler

preview_player
Показать описание
In this video, we implement Spring Batch functionality using different approaches.
The first approach is using Spring Batch Chunk to read CSV files, process data and store it in DB.
Then, we set the reader to consume REST API, process data, and store it in DB.
After that, we configure the Tasklet job.
Finally, we configure the Scheduler to run Spring Batch Job at some period.

00:00 - Intro
00:32 - Spring Boot Project Generation
02:22 - Entity, Repository
04:11 - Read File Batch Job
26:20 - Read REST API Batch Job
35:33 - Schedule Spring Batch Job Execution
41:45 - Spring Batch Tasklet
Рекомендации по теме
Комментарии
Автор

You are great ❤ love your effort really appreciated 👌

punyabikash
Автор

Thank you very much for the video! Can we use a second step or a second processor to send an email?

Assume the following scenario, step 1 will read data from csv, process the data and then write the data into the database. Then, step 2 will prepare and send emails containing a body which describes how many records were processed by step 1, when they were processed, how many were successfully inserted into the database and how many failed to be inserted into the database. Maybe some record of the cvs failed to pass our business logic and as a result they were not inserted into the database. Therefore, we should know how many records failed, which were the records that failed and why they failed.

How could we implement the above requirement? Using two steps of using two processors?

Thank you in advance!

ainigma
Автор

great tutorial, what about if i need to read data from oracle database and then this data returned has to be processed by a mysql stored procedure and write the result in a mysql table, how can i achieve this ? it is possible? thank you for share your knowledge

juancarlosrivera
Автор

can we use spring batch with a no sql database like firestore to write the data?

fatimaezzahramorchid
Автор

@Bean
public Job bookReaderJob(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
return new JobBuilder("bookReadJob", jobRepository)
.incrementer(new RunIdIncrementer())
.start(taskletStep(jobRepository, transactionManager))
.build();
}
from where its picking jobRepository? as i am getting nullpointer exception for that.

ashwanipandey