0

I am trying to setup and execute the Spring Cloud Tasks Sample of partitioned batch job (https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples/partitioned-batch-job) in Spring Cloud Data Flow Server.

But for some reason there are errors in the partitioned job tasks:

A job execution for this job is already running: JobInstance: id=2, version=0, Job=[partitionedJob]

Is the partition job incompatible with Spring Cloud Dataflow server?

J.D.
  • 23
  • 2

1 Answers1

1

Yes, the sample partitioned batch job is compatible with Spring Cloud Data Flow server and work out of the box so long as:

  • The datasource is either H2 or Mysql.
  • And you are using the Spring Cloud Data Flow Server Local

But it is difficult to diagnose the issue without knowing which Data Flow Server you are using and the database. Also were there any exceptions?

Glenn Renfro
  • 266
  • 1
  • 3
  • I have tried the Spring Cloud Task 1.0.3.RELEASE version and trying to deploy it in Spring Cloud DataFlow Local Server 1.0.1.RELEASE. The exception from the logs of the partitioned job is: Caused by: org.springframework.batch.core.repository.JobExecutionAlreadyRunningException: A job execution for this job is already running: JobInstance: id=4, version=0, Job=[partitionedJob] – J.D. Nov 22 '16 at 00:21
  • Thank you for providing the version. In this case it looks like the first time this job was running it did not finish (possibly killed by a ctrl-c). This can be confirmed by using Spring Cloud Data Flow's UI and looking at the Job Executions under the Job Tab and seeing that the the first job still has the status started. To get around this you can do one of 2 things: * – Glenn Renfro Nov 22 '16 at 13:40
  • * Truncate or delete the batch tables in the repo. Or just delete those job entries * Change the job name from `partitionedJob` to some other name. This is found here: https://github.com/spring-cloud/spring-cloud-task/blob/1.0.3.RELEASE/spring-cloud-task-samples/partitioned-batch-job/src/main/java/io/spring/JobConfiguration.java#L178 – Glenn Renfro Nov 22 '16 at 13:43