Search code examples
springspring-bootspring-batchspring-xd

How can we send Spring-xd shell commands from Batch Job


Im trying to relaunch a JobB by running JobA. I was trying to use jobOperater.restart() and I was unsuccessful. I was able to restart the jobB from the xd-shell by "job execution restart --id 0". Can i do something similar by calling that command from JobA. Thank you for your suggestions.


Solution

  • The spring-xd-rest-client jar has a SpringXDTemplate...

    xdTemplate.jobOperations().restartJobExecution(jobId)