0

Let's say I have following flow, Start->Step1->Step2->Step3->Step2->End

I have created tasklets for each step and configured a Job as above. When the job got triggered, the execution is fine till Step3 and it goes into a loop infinitely. So is there a way to a step more than once in a JobFlow.

I am using Spring Batch 4.2.1.RELEASE.

  • Does this answer your question? [Spring batch repeat step ending up in never ending loop](https://stackoverflow.com/questions/38871808/spring-batch-repeat-step-ending-up-in-never-ending-loop). If not, please share a [minimal complete example](https://stackoverflow.com/help/minimal-reproducible-example) that reproduces the issue to be able to help you. Moreover, I would be interested in hearing a real world valid use case for this kind of flows. Can you explain what you are trying to achieve without referring to Spring Batch? – Mahmoud Ben Hassine Mar 11 '21 at 14:12

1 Answers1

0

How are you writting your job? I used to have this kind of problem when I use many flows based on batch desions.

Have you tried something like this?

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