0

Application: ETL application written in java/Spring Batch/Oracle running on SpringBoot

Problem statement: There are several long-running SQL queries in a java job, query execution is the last step of the job. Sometimes query gets stuck at DB level and DB doesn't respond and eventually, the query is killed and the job has to be started again.

Now I want to implement (for both spring jobs and non spring jobs):

  1. a way to start the job at the failure point not from the top.
  2. High availability architecture so that users don't have to wait if the application server stops responding. Something similar to Hot-Hot architecture (Any Spring-based solution would be great)
Anju
  • 33
  • 1
  • 8

1 Answers1

0
  1. a way to start the job at the failure point not from the top.

Spring Batch provides that by default, given that you use a persistent job repository. If you restart a failed job instance, Spring Batch will restart from the last save point in the last failed step (unless your configure your steps to be restartable even if they were completed successfully)

  1. High availability architecture so that users don't have to wait if the application server stops responding.

If your database server is not responsive, neither Spring Batch nor any other tool can improve things here. What you can do is apply a timeout to your step and stop it if the timeout is exceeded. You can find a complete code example here: Restart step (or job) after timeout occours

Mahmoud Ben Hassine
  • 28,519
  • 3
  • 32
  • 50
  • Thanks for the help! I would definitely try this out for spring batch jobs. I need similar for java jobs(Non spring jobs). – Anju Feb 16 '21 at 09:14
  • ok great. If the answer helped, please accept it or upvote it. Otherwise let me know if you need more details. – Mahmoud Ben Hassine Feb 17 '21 at 10:56