The application is using Spring boot 2.7.0. I have an API - "/stopRunningJobs" and when this is triggered all the running spring batch jobs/APIs are stopped. Now, while this API is stopping all the running jobs, there may be a possibility of another API being called, which may end up in the "in-progress" or "completed" state rather than the "STOPPED" state. So, two inputs are needed-
Any input is appreciated. Thank you
After doing some research - I could not find any inbuilt annotation on this. We will have to manually queue all the incoming requests and persist the request at the database layer with all the needed parameters. When the API - "/stopRunningJobs" is completed, we can write a method or an API to fetch all the queued request from the database, iterate it along with the param and invoke the API asynchronously.
Thank you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.