Spring Batch jobs are executed via Spring Boot's
JobLaunchingCommandLineRunner. This guide also uses a CommandLineRunner
to verify the results of the job. This can cause state inconsistencies
between the two (job may run before or after the queries). This commit
adds a JobExecutionListener that decrements a CountdownLatch. The
queries wait for the latch to complete guaranteeing that the job has
completed.
Github Issue 8
This one has trickier issues to overcome, so I thought it more practical to
push the code to origin so I could ping other people, before having to worry
about writing the actual guide.