【问题标题】:Spring Batch: Is it possible to write to flat file till a threshold has reached and than write to a new one?Spring Batch:是否可以写入平面文件直到达到阈值然后写入新文件?
【发布时间】:2019-01-08 12:16:43
【问题描述】:

我想写入一个平面文件,直到达到某个阈值,一旦达到 - 创建一个新文件并写入它,Spring Batch 可以吗?

我发现一个旧问题的答案是不可能但不确定它是否已更新:

Spring Batch: Can i write to multiple files based on Size

另一种选择是使用块大小并手动处理文件创建,但如果存在这种功能,最好使用 Spring Batch 功能。 可能吗 ?

【问题讨论】:

    标签: spring-batch


    【解决方案1】:

    MultiResourceItemWriter 是您正在寻找的。您描述的阈值实际上是ItemCountLimitPerResource 参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多