Reputation: 105
We have created a Spring Batch job to be executed in Spring Cloud Data Flow through Spring Cloud Task (a simple task, it only executes the job). The execution has been checked both with the UI and the REST API, and everything is OK in an ideal case. The problem comes when we try to stop and restart a job. Following the REST API Guide:
And now the million dollar question: if we want to integrate SCDF with a planifier (like Control-M) how can we make polling requests to check the after-restart execution's status if the restart request does not return any execution id? If there is just a normal execution, we can send polling requests with the job execution id (step 4) associated to the task execution id (step 2), but after the restart we are "blind"
Upvotes: 2
Views: 1348
Reputation: 105
Well, I don't know if there is a directer way to do this, but this is a possible solution for the integration with an external system:
Upvotes: 1
Reputation: 4179
Here comes the first issue: if we stop the task with the task execution id (https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#api-guide-resources-task-executions-stopping) the job associated to the task stops its execution (in the logs) but in de database the job stays as "STARTED". And then it is impossible to restart the job execution as it never reachs the "STOPPED" status
This looks like a bug and feel free to report it at https://github.com/spring-cloud/spring-cloud-dataflow/issues. When reporting, please add any additional information such as the SCDF server log etc., to investigate it better.
if we want to integrate SCDF with a planifier (like Control-M) how can we make polling requests to check the after-restart execution's status if the restart request does not return any execution id? If there is just a normal execution, we can send polling requests with the job execution id (step 4) associated to the task execution id (step 2), but after the restart we are "blind"
SCDF server exposes REST endpoints to check the status of Job Executions. You can either hit the server endpoints or use the REST client to check. For more information on the REST client, you can check [here].1
Upvotes: 1