有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Spring批处理嵌套作业或步骤,以及如何在子分区器中访问父执行上下文

我有几个相互关联的问题

我在spring batch有一份工作,是一名分区员。它基本上加载了很多ftp配置

对于每个配置,我想下载一个文件列表,在下一步中,从列表中一次下载并上传一个文件

我对spring和spring batch非常陌生,所以我甚至不知道这是否可行?这是我的第一个问题

第二个问题是:我是否能像这样创造就业机会或流动。如何在子分区器中访问父executionContext

下面你可以举一个很糟糕的例子,我知道这基本上只是我想要的一个想法,甚至离工作不远

    <job id="loadFromFtpJob" xmlns="http://www.springframework.org/schema/batch">
    <step id="partitionedLoadFtpConfigurations">
        <partition partitioner="loadFtpPartitioner">
            <handler grid-size="1" task-executor="taskExecutor" />
            <step>
                <flow parent="downloadListFromFTPFlow" />
            </step>
        </partition>
    </step>
</job>

<!-- http://stackoverflow.com/questions/23357024/spring-batch-partitioning-with-multiple-steps-in-parallel -->
<flow id="downloadListFromFTPFlow" xmlns="http://www.springframework.org/schema/batch">
    <step id="partitionedLoadFtpFiles">
        <partition partitioner="LoadFtpFilesPartitioner">
            <handler grid-size="1" task-executor="taskExecutor2" />
            <step>
                <flow parent="downloadFtpListFlow" />
            </step>
        </partition>
    </step>
</flow>

<flow id="downloadFtpListFlow" xmlns="http://www.springframework.org/schema/batch">
    <step id="downloadFromFtp" next="uploadToFtp">
        <tasklet ref="downloadFromFtpTasklet" />
    </step>
    <step id="uploadToFtp" xmlns="http://www.springframework.org/schema/batch">
        <tasklet ref="uploadToFtpTasklet" />
    </step>
</flow>

共 (0) 个答案