Reputation: 669
I have setted the commit interval of 1000 . But, it is not working. Still, i am getting items at random intervals to my item writer . please advise.
<batch:step id="step1" next ="step2">
<batch:tasklet task-executor="simpleTaskExecutor" throttle-limit="20">
<batch:chunk reader="itemReader" processor="itemProcessor" writer="itemWriter" commit-interval="1000" />
<batch:listeners>
<batch:listener ref="appJobExecutionListener" />
<batch:listener ref="appJobFailureLoggerListener" />
<batch:listener ref="customStepListener" />
</batch:listeners>
</batch:tasklet>
</batch:step>
Upvotes: 0
Views: 832
Reputation: 1171
You are using an Async executor. (Guessing, you have not shown in the config) The async executor is set to 20, which means you can have up to 20 threads executing in parallel.
If you want to read records up to the commit interval and then process one chunk at a time, you should drop the task-executor from the config
Upvotes: 1