A batch job task that executes 2 jobs each job prints out the job name and a timestamp to stdout
. Intended to primarily be used for testing.
The timestamp task has the following options:
yyyy-MM-dd HH:mm:ss.SSS
)$ ./mvnw clean install -PgenerateApps $ cd apps/timestamp-batch-task $ ./mvnw clean package
java -jar timestamp-batch-task-<version>.jar
![]() | Warning |
---|---|
Launching a composed task with timestamp-batch app as it is, more than once, may lead task into ERROR status. This is due to JobInstanceAlreadyCompleteException, as JobInstance won’t be unique, if JobParameters remain the same. One of the way to handle this is to utilize JobParametersIncrementer as below: jobBuilderFactory.get("job1").incrementer(new RunIdIncrementer()) jobBuilderFactory.get("job2").incrementer(new RunIdIncrementer()) In this case RunIdIncrementer will allow the app to be launched multiple times, each having its own JobInstance |
We welcome contributions! Follow this link for more information on how to contribute.