How to detect a Flink Batch Job finishes

473 views Asked by At

Currently, I have a streaming job which is firing a batch job when it receives a specific trigger.

I want to follow that fired batch job and when it finishes, want to insert an entry to a database like elastic search or so.

Any ideas, how we can achieve this? How we can listen to that job?

1

There are 1 answers

0
BrightFlow On

FLINK provides some REST APIs to query job status, you could use this one to query batch job state: https://ci.apache.org/projects/flink/flink-docs-release-1.12/ops/rest_api.html#jobs-jobid. While tasks are running, their status will be reported to JM. Through this API, you can get the job state based on the response from the request.