Job executor priority by due date missing

Hello! I have a Spring Boot application with Camunda 7.17. The system processes long running jobs every minute, with up to 200 concurrent jobs. While time is not necessarily an issue, I encountered an issue where due to the high load, some jobs never get picked up for hours, which is much more than it should take.

I read in the documentation here that there should be a property called jobExecutorAcquireByDueDate, but when trying to add it in application.yaml, it does not find it.


The other related property, jobExecutorAcquireByPriority, works, but I cannot use it in the way my system was designed without major refactoring to 170+ processes.

Also, I checked in org.camunda.bpm.spring.boot.starter.property.CamundaBpmProperties, but the property seems to be missing from there.

Did I do anything wrong when trying to configure it? I am using Camunda 7.17 embedded engine with Spring Boot.

Hi @Cody_Newman,

you may have to use the generic properties to set the value: Process Engine Configuration | docs.camunda.org

Hope this helps, Ingo

1 Like

Thank you! I will test this solution during the next few weeks and see if the slowness is mitigated.

It seems this was not the solution. I tried the following configs, but none worked:

camunda:
  bpm:
    generic-properties:
      properties:
        job-executor-acquire-by-due-date: true
        job-executor-acquire-by-duedate: true
        job-executor-acquire-by-dueDate: true
        jobExecutorAcquireByDueDate: true
    job-executor-acquire-by-due-date: true

After that, I tried updating Camunda from 7.17 to 7.18, but the property still cannot be found.

Hi @Cody_Newman,

I cannot reproduce this, it works on my machine.

With your settings, the logs say:

[0;39m ==>  Preparing: select RES.ID_, RES.REV_, RES.DUEDATE_, RES.PROCESS_INSTANCE_ID_, RES.EXCLUSIVE_ from ACT_RU_JOB RES where (RES.RETRIES_ > 0) and ( RES.DUEDATE_ is null or RES.DUEDATE_ <= ? ) and (RES.LOCK_OWNER_ is null or RES.LOCK_EXP_TIME_ < ?) and RES.SUSPENSION_STATE_ = 1 and RES.PRIORITY_ >= ? and RES.PRIORITY_ <= ? and ( ( RES.EXCLUSIVE_ = true and not exists( select J2.ID_ from ACT_RU_JOB J2 where J2.PROCESS_INSTANCE_ID_ = RES.PROCESS_INSTANCE_ID_ -- from the same proc. inst. and (J2.EXCLUSIVE_ = true) -- also exclusive and (J2.LOCK_OWNER_ is not null and J2.LOCK_EXP_TIME_ >= ?) -- in progress ) ) or RES.EXCLUSIVE_ = false ) order by RES.DUEDATE_ asc LIMIT ? OFFSET ?

without, the logs say:

[0;39m ==>  Preparing: select RES.ID_, RES.REV_, RES.DUEDATE_, RES.PROCESS_INSTANCE_ID_, RES.EXCLUSIVE_ from ACT_RU_JOB RES where (RES.RETRIES_ > 0) and ( RES.DUEDATE_ is null or RES.DUEDATE_ <= ? ) and (RES.LOCK_OWNER_ is null or RES.LOCK_EXP_TIME_ < ?) and RES.SUSPENSION_STATE_ = 1 and RES.PRIORITY_ >= ? and RES.PRIORITY_ <= ? and ( ( RES.EXCLUSIVE_ = true and not exists( select J2.ID_ from ACT_RU_JOB J2 where J2.PROCESS_INSTANCE_ID_ = RES.PROCESS_INSTANCE_ID_ -- from the same proc. inst. and (J2.EXCLUSIVE_ = true) -- also exclusive and (J2.LOCK_OWNER_ is not null and J2.LOCK_EXP_TIME_ >= ?) -- in progress ) ) or RES.EXCLUSIVE_ = false ) LIMIT ? OFFSET ?

The first statement includes order by RES.DUEDATE_ asc LIMIT ? OFFSET ?, which is missing in the second statement.

This is the log level I used:

logging:
  level:
    "[org.camunda.bpm.engine.jobexecutor]": DEBUG
    '[org.camunda.bpm.engine.impl.persistence.entity.JobEntity]': DEBUG

Hope this helps, Ingo

1 Like

It did help, thank you!
I didn’t know how to see the SQL logs directly for Camunda, but with your config I was able to make it work. I confirm that the configuration did work and now the query is exactly as yours.

What made me believe that it did not work was the fact that a process was stuck on the process start element for over 40 minutes, without it being picked up and then it waited 30 minutes on a timer element (30 minutes after the timer ended/due date was reached).

Now with the exact query, I was able to check the jobs and saw that they are being processed very slowly, the results of the query are way behind based on their due date (it is over 10 minutes in the past). This is probably due to the high load on the testing environment and the VM resources that are less than half of the recommended amount for that kind of load.

For anyone else having my issue, the correct configuration is:

camunda:
  bpm:
    generic-properties:
      properties:
        job-executor-acquire-by-due-date: true