Home > Mobile >  Scheduler in springboot for huge data alternate of spring batch processing
Scheduler in springboot for huge data alternate of spring batch processing

Time:10-29

I have to run a schduler(any schduled jobs) where i have to fetch 300,000-400,000 in average twice daily from database and apply business logics one by one where each process requests to thirdparty which takes 3-4 seconds to respond. what are alternates of spring batch processing to process such huge data in efficient ways?

Note: fetched data are not static, data may vary everyday.

CodePudding user response:

May be @Scheduled annotation can help you out.

CodePudding user response:

You can use the Spring Batch schedular. It execute spring batch jobs periodically on fixed schedule using some cron expression passed to Spring TaskScheduler

To configure, batch job scheduling is done in two steps:

Enable scheduling with @EnableScheduling annotation. Create method annotated with @Scheduled and provide recurrence details using cron job. Add the job execution logic inside this method.

Here is the link of an example : https://howtodoinjava.com/spring-batch/job-scheduler-example/

  • Related