in the meanwhile i was able to figure out what i was missing. Thanks to the Book "Spring Batch in Action" p. 394 ff.
> My question is how do i setup the next step (ItemProcessor, ItemWriter) to fire the web requests based on the ExecutionContext i created and store the received data back?
Till now i thought the StepExecutionSplitter is an ItemReader somehow - providing the already read chunks/items whatever. Instead the StepExecutionSplitter prepares the context for each ItemReader - so we need one!
The PartitionHandler then looks like:
public Step myRealStep() throws Exception
SimpleStepFactoryBean<ProductInformation, Integer> stepFactory = new SimpleStepFactoryBean<>();
return (Step) stepFactory.getObject();
Then was able to declare the ItemReader (Processor/Writer) as:
public PartitionHandler partitionHandler() throws Exception
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler();
> I also see the the job is only starting the first (gridSize) threads and then stops. Whats the issue there?
public class MyItemReader implements ItemReader<MyEntity>, ItemStream
private int from;
private int to;
public MyEntity read() throws Exception, UnexpectedInputException, ParseException,
// now fetch the desired entity with jpa, hibernat or something
// dont forget: this method is called until it returns "null", so save the internal state
// and return one entity after another till you reach the boundary
public void open(ExecutionContext executionContext) throws ItemStreamException
from = executionContext.getInt("minId");
to = executionContext.getInt("maxId");
I simply was creating to few ExecutionContexts with too few data. So nothing special here.
Hope this helps someone.