首页 > 解决方案 > 如果上一步失败,如何执行下一步?

问题描述

我有以下工作配置:

    return jobBuilderFactory.get("read-file-job")
            .start(stepBuilderFactory.get("master-step")
                    .partitioner("myPartitioner", partitioner)
                    .step(processChunk)
                    .aggregator(myAggregator)
                    .taskExecutor(partitionerExecutor())
                    .build()
            ).next(removeFilesStep)
            .build();

如果聚合器抛出 RuntimeException,则跳过 removeFilesStep。

我怎么能避免呢?

标签: javaspring-batch

解决方案


推荐阅读