So I have a Spring Batch Project has one repeated step.
<batch:job id="fooJob">
<batch:step id="barStep">
<batch:tasklet>
<batch:chunk reader="myReader" writer="myWriter"
commit-interval="5">
</batch:chunk>
</batch:tasklet>
</batch:step>
</batch:job>
The reader is a JdbcCursorItemReader
that also has a RowMapper
to store the information it retrieves from the database into a POJO. Then "myWriter"
writes the fields set in the POJO to a text file. And this happens regularly (dictated by cron).
How do I set a condition to skip the itemWriter altogether when the database is empty and the reader can't read anything?