What is the function of JobBuilderFactory.get(job).incrementer(RunIdIncrementer)?

試著忘記壹切 提交于 2019-12-03 14:48:39

This isn't a "Boot thing" as much as it is a "Batch thing". Spring Batch has the rule that a JobInstance can only be run once to completion. This means that for each combination of identifying job parameters, you can only have one JobExecution that results in COMPLETE. A RunIdIncrementer will append an additional, unique parameter to the list of parameters so that the resulting combination would be unique...giving you a new JobInstance each time you ran the job with the same combination of identifying parameters.

The RunIdIncrementer is really just a special case of the JobParametersIncrementer which you can read more about in our documentation here: http://docs.spring.io/spring-batch/trunk/reference/htmlsingle/#JobParametersIncrementer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!