I am migrating from plain spring batch to spring cloud task and spring batch executed through spring cloud data flow. I am experiencing the below problem in both my job and the example job that I have deployed for file injest:
I am using the spring-cloud-dataflow-server-local-1.4.0.RELEASE with a postgres backend. I have also adapted the example to work with the postgres database.
The problem occurs when I attempt to run the task a second time with a different argument. When I run it the first time:
task launch fileInjectTask --arguments "filePath=classpath:data.csv --spring.cloud.task.closecontext_enable=false"
The following is the output in the logs:
2018-03-22 10:10:51.446 INFO 10431 --- [ main] o.s.b.a.b.JobLauncherCommandLineRunner : Running default command line with: [filePath=classpath:data.csv, --spring.cloud.task.closecontext_enable=false, --spring.cloud.task.executionid=13]
2018-03-22 10:10:51.497 INFO 10431 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : Job: [FlowJob: [name=ingestJob]] launched with the following parameters: [{filePath=classpath:data.csv, -spring.cloud.task.executionid=13, -spring.cloud.task.closecontext_enable=false, run.id=1}]
So that's fine, the parameter gets passed to the batch job. Now, when I attempt to run the same task with a different argument to the task:
task launch fileInjectTask --arguments "filePath=/home/hmcmanus/spring-cloud-dataflow-samples/batch/file-ingest/src/main/resources/data.csv --spring.cloud.task.closecontext_enable=false"
I get the following in the logs:
2018-03-22 10:12:18.249 INFO 10554 --- [ main] o.s.b.a.b.JobLauncherCommandLineRunner : Running default command line with: [filePath=/home/hmcmanus/spring-cloud-dataflow-samples/batch/file-ingest/src/main/resources/data.csv, --spring.cloud.task.closecontext_enable=false, --spring.cloud.task.executionid=14]
2018-03-22 10:12:18.322 INFO 10554 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : Job: [FlowJob: [name=ingestJob]] launched with the following parameters: [{filePath=classpath:data.csv, -spring.cloud.task.executionid=13, run.id=1, -spring.cloud.task.closecontext_enable=false}]
As you can see the second example the arguments to the task are fine, however the arguments to the batch job are the old arguments of the task execution.
Is there something that I'm missing here? Why doesn't the spring batch job get the parameters of the new task execution?
Update
To rule out differences in database and any modifications that I needed to make in order for it to run I have also verified the same functionality with the embedded H2 database for both the data flow server and the task.