Announcement Announcement Module
Collapse
No announcement yet.
Using CommandLineJobRunner with SimpleAsyncTaskExecutor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using CommandLineJobRunner with SimpleAsyncTaskExecutor

    I would like to understand if it is possible to use the CommandLineJobRunner with the SimpleAsyncTaskExecutor.

    We currently have a job which executes perfectly whilst using a SyncTaskExecutor. However, whenever we use an SimpleAsyncTaskExecutor, it shuts down immediately without any errors being thrown and an Exit Code of 1

    Debugging through the code, what we find is that the CommandLineJobRunner does not wait for the Job Execution to complete after calling JobLauncher.run

    Code:
    JobExecution jobExecution = launcher.run(job, jobParameters);
    			return exitCodeMapper.intValue(jobExecution.getExitStatus().getExitCode());
    We can see the background threads starting up when debugging. However, due to the fact that the CommandLineJobRunner is not going to wait for the job to complete, the entire program ends.

    Is this the intended behavior? Should CommandLineJobRunner wait for the Job to finish execution before calling exit, or is it a case whereby the CommandLineJobRunner was not intended to use an AsyncTaskExecutor.

    Thanks and regards

    Jega

  • #2
    Found a solution

    Sorry for the trouble. Didn't realize the <split> element requires a AsyncTaskExecutor defined in it's task-executor attribute.

    For those facing a similar issue, Parallel Steps contains the necessary documentation.

    Sorry once again

    Regards

    Jega

    Comment

    Working...
    X