Skip to content

Commit a4c9525

Browse files
committed
Update run.id to be an identifying parameter in RunIdIncrementer
Before this commit, the run.id parameter was bootstrapped as a non-identifying job parameter, which does not make sense as this is the discriminator between job instances when using this incrementer. This commit flips the default identification flag to true.
1 parent 62c4cbf commit a4c9525

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/job/parameters/RunIdIncrementer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919

2020
/**
2121
* This incrementer increments a "run.id" parameter of type {@link Long} from the given
22-
* job parameters. If the parameter does not exist, it will be initialized to 1. The
23-
* parameter name can be configured using {@link #setKey(String)}.
22+
* job parameters. If the parameter does not exist, it will be initialized to 1 and marked
23+
* as an identifying job parameter. The parameter name can be configured using
24+
* {@link #setKey(String)}.
2425
*
2526
* @author Dave Syer
2627
* @author Mahmoud Ben Hassine
@@ -51,7 +52,7 @@ public JobParameters getNext(JobParameters parameters) {
5152
Assert.notNull(parameters, "JobParameters must not be null");
5253
JobParameter<?> runIdParameter = parameters.getParameter(this.key);
5354
long id = 1;
54-
boolean isIdentifying = false;
55+
boolean isIdentifying = true;
5556
if (runIdParameter != null) {
5657
try {
5758
id = Long.parseLong(runIdParameter.value().toString()) + 1;

0 commit comments

Comments
 (0)