I have an external task on my BPMN scheme and its realization by External Task Client Spring Boot Starter | docs.camunda.org.
How can I handle technical error on it? For example, if the service-worker goes down with OutOfMemory and there is no way to handle error internally.
- The service goes down, but the external task ‘lives’ until the lock time expires
- The lock time expires
- The execution goes to flow B (another service) without retries
Is there a way to handle incident or lock time expiration?
Since nobody posted a proposal yet, I’ll write down my thoughts:
For one, a service-worker running out of memory is a technical error. I’d prefer to handle such an error outside the business process, since the business logic should not be convoluted with technical details. You can read more about this here.
You could, instead, use an interrupting timer boundary event, that is triggered after a certain time and continues the flow if the task did not complete.
An alternative would be to wrap your service in another service. If the inner service succeeds, the outer service does nothing but forwarding the result. If the inner service crashes, the outer service can raise a BPMN error, which can be handled in your process. This post might be good as an inspiration.
Does this help?
Hello @mikheev17 ,
additional to what @StephanHaarmann wrote:
My suggestion would be to make the lock duration relatively short (2 minutes max) and extend the lock while doing a longer calculation.
If the calculation might include intermediate results (that can be saved somewhere), you might also send variables to the workflow to track the progress.
If the worker then goes down unexpectedly, you will
- Continue quite fast (as the lock timeout is max 2 minutes)
- Pick up from where you left
I hope this helps
@StephanHaarmann , @jonathan.lukas
Thank you so much! Both of your answers are very helpful for me!