我想将此spring批处理作业的XML标记转换为基于java的注释,但似乎我无法在java config中找到处理程序属性
XML配置
<job id="partitionJob" xmlns="http://www.springframework.org/schema/batch">
<step id="masterStep">
<partition step="slave" partitioner="rangePartitioner">
<handler grid-size="10" task-executor="taskExecutor" />
</partition>
</step>
</job>
Java配置
@Bean
public Step masterStep() throws Exception {
return stepBuilderFactory.get("exportStep")
.partitioner(slave().getName(), rangePartitioner())
.step(slave()())
.gridSize(10)
.taskExecutor(taskExecutor())
.build();
}
@Bean
public Job partitionJob() throws Exception {
return jobBuilderFactory.get("partitionJob")
.incrementer(new RunIdIncrementer())
.start(masterStep())
.build();
}