How exactly do you extend a lock for a task?

Hi, I currently have my tasks implemented via fetch_and_lock() with an extremely long lock duration, but would like to convert that into shorter lock durations that are periodically extended.

Basically what this blog post is explaining: https://blog.camunda.com/post/2017/10/extending_locks_of_external_tasks/
“Every 25 minutes, the first server can report that it is still working on the task and will need at least 30 minutes more. In case it has neither reported “complete” nor extended the lock after another 30 minutes, the task will be unlocked by Camunda and can be fetched for execution by another server…”

I am wondering, what are the methods used to query the server for it to report whether it is still working on the task?

Thank you

Hi @jw127,

what about this request: https://docs.camunda.org/manual/latest/reference/rest/external-task/get/?

You should get all informations you need in the reponse body (workerId, lockExpirationTime, …).

Hope this helps, Ingo

1 Like