【发布时间】:2020-12-14 11:50:42
【问题描述】:
我需要创建一个 spring 批处理,其中我需要从 2 个不同的表中获取数据。 这将是读者部分。
问题是我需要有 2 个读者查询。并且只会根据条件调用其中一个。 但作家将是一样的。 这样tasklet就基本一样了。
我可以在一个步骤中拥有 2 个读取器,根据条件调用它吗..??
类似spring批处理xml里面的东西:
if (condition)
then reader1
else reader2
...
....
......
<reader1 id=".." class="..">
</reader1>
.....
........
<reader2 id=".." class="..">
</reader2>
【问题讨论】:
-
only one of them will be called based on the condition: 条件是什么?工作参数?系统属性?在上一步中计算的东西?我认为您的情况不需要两个阅读器,这是 IMO 配置的问题。
标签: spring spring-batch