You shouldn't be manually creating threads and calling the executor. Set the executorService
of the SimpleJobLauncher
, and call runJob
with your two jobs. They'll run in parallel because the executorService
has more than 1 thread. (And you can remove your Thread1 and Thread2 beans.)
To check completion, either periodically check the returned JobExecution
s from runJob
, or use a JobExecutionListener
.