External task handler interrupting


Could you help me, what is the best way to interrupt an external task handler execution?

I have the process like that:

“Report processing” - external task, which is handled by another microservice “m” (implementation with starter External Task Client Spring Boot Starter | docs.camunda.org).
I want to interrupt not only the business process execution (complete external task), but interrupt the thread, in which the “m” work - stop processing inside m.

Is there a standard/event-based mechanism or something else?

Hello @mikheev17 ,

thank you for coming to the forum and welcome.

The mechanism described here (using the message boundary event) is not forwarded to your task worker.

However, one idea could be to implement the message correlation so that:

  1. The worker saves an “interrupt hook” as process variable after claiming the task
  2. On interrupt, the activity is interrupted first
  3. In case the message correlation is successful, the interrupt hook process variables is used to interrupt the worker.

As an alternative, the worker could from time to time extend the claim duration of the external task (this is recommended on long running external tasks). If this fails, he could react by interrupting the processing as well.

I hope this helps


1 Like

Jonathan, thank you for your answer!

The alternative case (with extending lock) is great for me!

1 Like