使用Spring Batch和Spring Boot来添加Job参数,我可以这样做:
public JobParameters getJobParameters() {
JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
jobParametersBuilder.addDate("date", new Date());
JobParameters jobParams = jobParametersBuilder.toJobParameters();
return jobParams;
}
将其放入执行的步骤中
@Bean
@StepScope
public JdbcPagingItemReader<CaseHeaderPojo> pagingItemReader(@Value("#{jobParameters['message']}") String message,
@Value("#{jobParameters['time']}") Long time) {
...
并通过
启动JobExecution jobExecution=jobLauncher.run(job, getJobParameters());
问题,我该如何添加验证?
谢谢