【问题标题】:Spring Batch Running duplicate steps(more than once) in a taskletSpring Batch 在一个小任务中运行重复的步骤(不止一次)
【发布时间】:2021-06-09 10:34:58
【问题描述】:

假设我有以下流程, 开始->Step1->Step2->Step3->Step2->结束

我已经为每个步骤创建了 tasklet 并如上所述配置了一个 Job。 当作业被触发时,执行到 Step3 之前都很好,它会无限循环。 那么有没有办法在 JobFlow 中多次执行步骤。

我正在使用 Spring Batch 4.2.1.RELEASE。

【问题讨论】:

标签: spring spring-batch spring-batch-tasklet


【解决方案1】:

你的工作写得怎么样?当我使用基于批处理的许多流时,我曾经遇到过这种问题。

你尝试过这样的事情吗?

@Bean
fun jobSincAdUsuario(): Job {
    estatisticas.reset()
    return job.get("batch-job")
            .incrementer(RunIdIncrementer())
            .start(step1())
            .next(step2())
            .next(step3())
            .next(step2())
            .build().build()
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-07
    • 1970-01-01
    • 1970-01-01
    • 2023-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多