Spring Batch 4.1.0.M2 已发布,可从 Maven Central、Github 和 Pivotal 下载仓库获取。
通过两个新的构建器来简化远程分区: RemotePartitioningMasterStepBuilder
和 RemotePartitioningWorkerStepBuilder ,
这些新构建器负责配置基础架构 bean 的繁重工作。
@Configuration@EnableBatchProcessing@EnableBatchIntegrationpublic class RemotePartitioningAppConfig { @Autowired private RemotePartitioningMasterStepBuilderFactory masterStepBuilderFactory; @Autowired private RemotePartitioningWorkerStepBuilderFactory workerStepBuilderFactory; @Bean public Step masterStep() { return this.masterStepBuilderFactory .get("masterStep") .partitioner("workerStep", partitioner()) .gridSize(10) .outputChannel(outgoingRequestsToWorkers()) .inputChannel(incomingRepliesFromWorkers()) .build(); } @Bean public Step workerStep() { return this.workerStepBuilderFactory .get("workerStep") .inputChannel(incomingRequestsFromMaster()) .outputChannel(outgoingRepliesToMaster()) .chunk(100) .reader(itemReader()) .writer(itemWriter()) .build(); } // Middleware beans setup omitted}
有关更改的完整列表,请查看 更改日志 或 发行公告 。