I’m new to Camunda and BPMN in general and I have one question about External Taks. Right now I’ve got a few external tasks with the same topic-name, for these external tasks I have to call a REST service and based on the response I have to complete the task or leave it uncompleted. My worker fetchs and locks 1 task every 7 minutes (using cron and Spring boot). My question is, when I do fetchAndLock, the selected task is random? In that case for example the fetch and lock request could try to complete the same task 20 times, and the other tasks remain blocked meanwhile, how can I avoid that?
assuming you’re not using priority then it’s more so unpredictable than it is random.
I can’t see this happening. Fetch and Lock would only return unlocked tasks. Can you explain under what circumstances you would expect to see blocking?
Assuming for example I have 20 external tasks on the same topic:
My worker fetch and lock one of the external tasks, it checks the service and the task shouldn’t be completed yet, then after the lock duration the task is unlocked without completion.
Then my worker fetchs and lock again another task and imagine (because you said the task selection is unpredictable) you lock again the same previous task, again it remains without completion…
There is a small chance (increased with the number of external tasks) that some task are never fetched and locked so they will never complete.