External task initial timeout

Hi,

I’m looking into Camunda as a solution to orchestrate our micro-services architecture. I would, therefore, make heavy use of the external task activities.

The fetchAndLock API, with its timeouts and retries, seems to handle all but one error conditition: what if there are no workers fetching a topic? How long will messages be stacked in this queue? Is there a way to setup an initial timeout for a task, so that it raises an incident if no one fetches it?

Best regards
Carlos Jourdan

Hi Carlos,

you can model this behavior in your process. For example, add a timer boundary event to the service task. After the given time is reached, you can leave the task, send a notification or create an incident.

Does this help you?

Best regards,
Philipp

Hi Philipp,

Technically that would work, but I think it would pollute a lot our workflows.

Our applications would look a lot like this example from Bernd Rücker’s blog:

If I have to set up a timer boundary event for each external task it will be a lot of boilerplate work. So, if there is no functionallity for this in the framework yet, I guess I’ll prefer to set up some sort of monitoring on the outset to make sure there are no lingering tasks…

Cheers

Hi @carlosjourdan,

currently, there is no built-in monitoring for this. So, you must build something yourself.

Best regards,
Philipp

Hi @carlosjourdan,

you can use a custom parse-listener to add a timer job for each external task in the background without modeling it.

Here is an example, that you have to adopt to your use case: https://github.com/camunda/camunda-bpm-examples/tree/master/process-engine-plugin/bpmn-parse-listener-on-user-task

Does it help you further?

Cheers, Ingo

2 Likes

That looks promissing. Thanks.

I have similar requirements as @carlosjourdan and got the BPMN Parse Listener to work for ServiceTasks. But how do I concretely implement the timeout behavior for a ServiceTask?

Thanks,
Wilko