【发布时间】:2018-09-03 09:21:12
【问题描述】:
<job id="firstJob" restartable="true"
xmlns="http://www.springframework.org/schema/batch">
<step id="FirstStep">
<tasklet>
<chunk reader="read" writer="write"
commit-interval="1" />
</tasklet>
</step>
</job>
<job id="second_job" restartable="false"
xmlns="http://www.springframework.org/schema/batch">
<step id="second_step" ">
<tasklet>
<chunk reader="reader_again" writer="writera_gain"
commit-interval="500" />
</tasklet>
</job>
我在这里有两份工作(我的实际代码中有 3 份)。我想运行第一个作业以检查数据库中的某些值,并且仅在找到该值后才执行。为此,我希望它继续循环,直到它可以找到数据然后继续。我怎样才能通过 Spring Batch xml 做到这一点?有没有更好的方法来做到这一点?
此外,由于代码库的大小,我无法更改结构,即将两个作业分为两个步骤。
【问题讨论】:
标签: java spring spring-boot spring-batch batch-processing