【问题标题】:Spring integration for large file大文件的Spring集成
【发布时间】:2013-01-15 18:53:50
【问题描述】:

我需要使用spring集成对大数据包执行ETL操作。 例如,我有巨大的 xml 文件,例如:

<school>
    <cource name="A">
        <class>
            <name>A1</name>
            <students>20</students>
        </class>
        ...
        <class>
            <name>A35</name>
            <students>19</students>
        </class>
    </cource>
    <cource>
    ...
    </cource>
</school>

结果应该是2个cvs文件:

第一:

A1;20
...
A35;35

第二:

A; 754
..
C; 232

即简单的转换操作和容器上的一些聚合功能。 “类”和“课程”记录的数量非常大,我无法解析内存中的输入数据(所以我需要按元素迭代), 但我仍然不想使用集成模式来轻松修改 ETL 流程。

有什么办法可以做到吗?

【问题讨论】:

    标签: java etl batch-processing large-files spring-integration


    【解决方案1】:

    您可以使用 Spring Integration 来检测文件的存在并启动 Spring Batch 作业(使用提供的 spring-batch-integration 项目中提供的 JobLaunchingMessageHandler spring-batch-admin)。

    【讨论】:

      【解决方案2】:

      您可以创建一个与 ItemReader 和 ItemWriter 关联的步骤。大文件是流式传输的,而不是作为一个整体读取的。所以,这应该可以发挥作用。

      更多阅读here。示例here

      【讨论】:

      • 你的例子来自 Spring Batch,而不是 Spring 集成。
      猜你喜欢
      • 2018-03-06
      • 2018-08-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-25
      • 1970-01-01
      相关资源
      最近更新 更多