Camunda Timer Event take more than sepecified

Hi Team,

I have attached a timer delay of PT10S between 2 service tasks. But the timer event is taking more than 50sec. Please help how to overcome this problem.

My basic need is to add a delay between 2 service tasks.

<bpmn2:intermediateCatchEvent id=“IntermediateCatchEvent_1” name=“timer”>

  <bpmn2:timerEventDefinition id="TimerEventDefinition_1">
    <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">PT10S</bpmn2:timeDuration>
  </bpmn2:timerEventDefinition>
</bpmn2:intermediateCatchEvent>

Hi,

Id like to point out that the intent of a timer is the transition is guaranteed not to occur before the time is up. The transition can occur sometime after the time is up…

The reason you may see a 50s delay is because, the time may be up and thus the transition as a job in the job table becomes available for job acquisition. However if the job acquisition thread is sleeping, the job will wait until the thread wakes up. Hence the job acquisition thread pools the job table.

You can configure the polling to be more aggressive, have a look at the job executor configuration in the docs…

regards

Rob

Thanks Rob. Can you please suggest the best configuration with which we can complete the timer task in specified interval (PT5S)?

Hi,

Based on my experience, with such fine grained timers, I would say dont go there! You could set the job executor to be more agressive…

The real question is what are you trying to achieve? You seem to want to introduce a small dwell between two service tasks - is this trying to avoid a race condition or what?

regards

Rob

Hi Rob, Service task 1 makes a REST call. It responds with a response. Service task 2 depends on Task1 to complete successfully and need to wait for sometime.

Yes am introducing this delay to avoid race condition. I have made below changes to Job configuration, please suggest.

<job-acquisition name="default">
<properties>
  <property name="maxJobsPerAcquisition">5</property>
  <property name="waitTimeInMillis">1000</property>
  <property name="lockTimeInMillis">300000</property>
  <property name="maxWait">3000</property>
</properties>
<!-- Note: the following properties only take effect in a Tomcat environment -->
<property name="queueSize">5</property>
<property name="corePoolSize">3</property>
<property name="maxPoolSize">10</property>
<property name="keepAliveTime">0</property>