接上一章,本章我们介绍Job的启动与监听。
Running a Job
Spring Boot默认支持自动启动已配置好的Job,我们可以通过配置项**spring.batch.job.enabled=false**
来禁止Spring容器自动启动Job。正常情况下,当我们通过调度器调用Job时,整个流程如下:
A JobExecution,is the primary storage mechanism for what actually happened during a run and contains many more properties that must be controlled and persisted
当Job启动之后,一个JobExecution对象会传递给Job的执行方法体,JobExecution负责存储Job执行期间执行信息,比如:状态、开始结束时间、最终退出状态、异常信息、执行上下文等等,并且最终会被传递给调用方。
run