Home Spring Batch successful async job ending early
Reply: 0

Spring Batch successful async job ending early

Maurice.Moss
1#
Maurice.Moss Published in 2017-12-06 21:10:22Z

I am running a multi-threaded Spring Batch job via a FlowBuilder splitting with a SimpleAsyncTaskExecutor.

The data I need to process is being read via ItemReaders and processed with ItemWriters, however I am noticing that the jobs will be marked as COMPLETED in my BATCH_STEP_EXECUTION table, and run without error, but there will be a small amount of records that should have been read + processed that were not.

So the job is ending early despite not having a failing condition.

Here is the job() method for my Job class

splitFlow = new FlowBuilder<Flow>("splitFlow").start(flows.get(0)).split(new SimpleAsyncTaskExecutor())
                .add(flows.get(1), flows.get(2), flows.get(3), flows.get(4)).build();

return jobs.get(jobName).start(splitFlow).end().build();

flows is an ArrayList of Flows that is populated via iterating over a range to get Steps based on the iterator's value

final List<Flow> flows = new ArrayList<();
for (int i = 6; i <= 10; i++) {
            final Flow flow = new FlowBuilder<Flow>("flow" + String.valueOf(i)).from(getStep(i)).end();
            flows.add(flow);
        }
flows.add(flow);
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.29982 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO