Delay in initiating external task processes

May I ask you a question about Camunda7.22? In the process I defined, there are only two simple external tasks. After the process starts, the first external task receives a message and is triggered with a delay of a few seconds to a few minutes. After the process starts, the external task is not executed for a long time. The external tasks in the following steps receive messages and execute them in milliseconds. What is the reason for this? How to configure the process to immediately trigger the execution of the first external task?

Hi @pandayao

In case there are less jobs in ACT_RU_JOB table than (maxJobsPerAcquisition) , the job acquisition waits for (waitTimeInMillis) before submitting jobs to the queue. If this keeps happening over and over again, the wait time will increase rapidly by multiplying it with the waitIncreaseFactor , but it won’t exceed the maximum waiting time (maxWait) .

Try the following values

https://docs.camunda.org/manual/latest/user-guide/spring-boot-integration/configuration/#camunda-engine-properties

What do you mean by that?

Hi @hassang

Thank you for your reply. I have tried this configuration, but the problem remains.
I am not sure whether it is the configuration problem of the engine side or the configuration problem of external tasks.
I use runtimeService.startProcessInstanceByKey to start the process, and the external task client uses @ExternalTaskSubscription to handle the task.
As shown in the process, after the process is started, doTest1() in the external task test1 subscription is sometimes triggered immediately, and sometimes it is delayed for a long time. I am not sure what the delay is for. I hope that the external task can be executed immediately after the process is started, please help me analyze it, thank you very much.

diagram_test.bpmn (3.1 KB)
test

The external task is a message subscription mechanism, by which I mean that the first external task is triggered to execute.

Hi @pandayao

Yes, that’s correct. It’s related to the external task configuration. You need to disable the backoff strategy and set the async-response-timeout to an appropriate duration.

async-response-timeout: 10000 # Defines the maximum duration of the long-polling request
disable-backoff-strategy: true

Hi @hassang

Thank you very much. The problem is solved by using the disable-backoff-strategy parameter in the external task configuration.

1 Like