1
votes

I am trying to make my Spring Batch Admin console display the execution steps in the order they are executed. I have included an example with two steps for the purpose of the question. Step1 executes before Step2 because of how the job execution is setup in the xml; in the admin console however it is not showing them in this order. I have other jobs with many steps and the order on the Spring Batch Admin console page seems to be random (it is not alphabetical, not in the order of execution, etc).

This is a copy of what my Spring Batch Admin console displays:

StepName..Reads..Writes..Commits..Rollbacks..Duration..Status

step2...............0..........0.............1...............0.........00:00:05....COMPLETED

step1...............0..........0.............1...............0.........00:02:05....COMPLETED

From looking at the console it looks as if step2 will execute then step1. This is not the case because the job is setup to run the steps in order (step1 runs before step2). Has anyone had any success ordering the execution steps on the console in the actual order they are executing?

Thanks

1

1 Answers

1
votes

You can inspect the JobExecutionController to see how the order of steps is constructed in the version of spring batch admin you are using.

Originally, the order was based on the execution history (e.g. if the step 2 was executed before step 1 in the very first execution of the job it will stick as first for good)

Judging from https://github.com/spring-projects/spring-batch-admin/commit/791d46c4bcd5a23e55507961f5f690cd79e6601f

this will be fixed in the version 2.0 - the order will be given by id