Repository navigation
Spring Batch Graceful Shutdown for Chunk Oriented Steps and Tasklet #5492
|
@fmbenhassine I had reviewed your updated v6 example here -> https://github.com/spring-projects/spring-batch/blob/main/spring-batch-samples/src/main/java/org/springframework/batch/samples/shutdown/README.md and had few questions:
Current my spring boot spring batch application implements CommandLineRunner and I believe I could still keep it the same way accommodating all these features. your guidance is much appreciated as always! |
Replies: 1 comment
Conceptually, a tasklet is at a different level of abstraction than a step, so it should NOT be a
In v6, the
You can use the same class, but similar to the previous point, you need to fetch the failed execution and restart it through the operator.
Yes, the job operator should be configured with an asynchronous executor to run jobs in background threads so that the main thread can proceed and register the shutdown hook for the job execution. |
Conceptually, a tasklet is at a different level of abstraction than a step, so it should NOT be a
StoppableStep, it should rather be aStoppableTasklet. It is the upper-levelTaskletStepthat will propagate the stop signal to the underlying tasklet.In v6, the
JobOperatorwas redesigned to use domain objects for job operations instead of primitive types (see #4845). Therefore, you …