Closed spring-projects-issues closed 9 years ago
Walter Morykon opened BATCH-2346 and commented
When attempting to execute multiple flow in parallel e.g.
FlowBilder flowBuilder = FlowBuilder<SimpleFlow>("Parallel Flows") .start(flowA) .split(new SimpleAsyncTaskExecutor()) .add(flowB, flowC) .build()
The result is that flowB and flowC run in parallel, but flowA never runs.
Looking at the add method of the FlowBuilder class
public FlowBuilder<Q> add(Flow... flows) { Collection<Flow> list = new ArrayList<Flow>(Arrays.asList(flows)); String name = "split" + (parent.splitCounter++); int counter = 0; State one = parent.currentState; Flow flow = null; if (!(one instanceof FlowState)) { FlowBuilder<Flow> stateBuilder = new FlowBuilder<Flow>(name + "_" + (counter++)); stateBuilder.currentState = one; flow = stateBuilder.build(); } if (flow != null) { list.add(flow); } State next = parent.createState(list, executor); parent.currentState = next; return parent; }
Since flowA is wrapped in a FlowState it will not be added to the list and hence will not be run by the executor.
Affects: 3.0.3
2 votes, 4 watchers
Michael Minella commented
Fixed: https://github.com/spring-projects/spring-batch/commit/652ca038f901e0425935d298ce565a0efa0bcaaa
Walter Morykon opened BATCH-2346 and commented
When attempting to execute multiple flow in parallel e.g.
The result is that flowB and flowC run in parallel, but flowA never runs.
Looking at the add method of the FlowBuilder class
Since flowA is wrapped in a FlowState it will not be added to the list and hence will not be run by the executor.
Affects: 3.0.3
2 votes, 4 watchers