使用Spring Batch 3.0.4.RELEASE .
我将作业配置为使用分区步骤 . 从属步骤使用块大小1.任务 Actuator 中有六个线程 . 我运行这个测试的网格大小从六到几百 . 我的网格大小是我期望的从属StepExecutions的数量==我的分区器创建的ExecutionContexts的数量 .
结果总是如此:
六个线程获取六个不同的步骤执行并执行它们 successfully . 那么 the same six step executions run again and again 在同一个帖子里!
我注意到RepeatTemplate.executeInternal(...)中有一个永远不会结束的循环 . 它继续执行相同的StepExecution只是递增版本 .
这是Java配置代码:
@Bean
@StepScope
public RapRequestItemReader rapReader(
@Value("#{stepExecutionContext['" + RapJobConfig.LIST_OF_IDS_STEP_EXECUTION_CONTEXT_VAR + "']}") String listOfIds,
final @Value("#{stepExecutionContext['" + RapJobConfig.TIME_STEP_EXECUTION_CONTEXT_VAR + "']}") String timeString) {
final List farms = Arrays.asList(listOfIds.split(",")).stream().map(intString -> a