Код: Выделить всё
BatchConfiguration< /code>: исходный файл конфигурации задания пакета
BatchConfigurationV2
Вот как я инициализации своего строителя заданий для BatchConfiguration (First Patch Patch Dab Configuration):
@Bean
public Job jsonProcessingJob(JobRepository jobRepository, Step jsonProcessingStep) {
return new JobBuilder("jsonProcessingJob", jobRepository)
.incrementer(new RunIdIncrementer())
.listener(jobExecutionListener())
.start(jsonProcessingStep)
.build();
}
JobExecution jobExecution;
jobExecution = jobLauncher.run(jsonProcessingJob, jobParameters);
//here jsonProcessingJob is the job name for the first batch config file.
ExecutionContext context = jobExecution.getExecutionContext();
< /code>
и для второго: < /p>
@Bean
public Job jsonProcessingJobV2(JobRepository jobRepository, Step jsonProcessingStepV2) {
return new JobBuilder("jsonProcessingJobV2", jobRepository)
.incrementer(new RunIdIncrementer())
.listener(jobExecutionListenerV2())
.start(jsonProcessingStepV2)
.build();
}
jobExecution = jobLauncherV2.run(jsonProcessingJobV2, jobParameters);
ExecutionContext context = jobExecution.getExecutionContext();
< /code>
Я хочу, чтобы, если я инициализировал второй файл задания, чтобы выполнить выполнение. Таким образом, он должен забрать только файл конфигурации, указывающий на второй файл BatchConfiguration, а не на первый.
Подробнее здесь: https://stackoverflow.com/questions/796 ... ning-every