# Job executor priority by due date missing

**URL:** <https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [March 8, 2023, 9:27am UTC](https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083 "2023-03-08T09:27:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cody\_Newman](https://forum.camunda.io/user_avatar/forum.camunda.io/cody_newman/32/21038_2.png) [@Cody\_Newman](https://forum.camunda.io/u/Cody_Newman)\
**Post date:** [March 8, 2023, 9:27am UTC](https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083/1 "2023-03-08T09:27:03Z")

</div>

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](https://docs.camunda.org/manual/7.17/user-guide/process-engine/the-job-executor/#the-job-order-of-job-acquisition) that there should be a property called jobExecutorAcquireByDueDate, but when trying to add it in application.yaml, it does not find it.

 ![image](https://forum.camunda.io/uploads/default/original/3X/0/6/06768357f7d768d10dfcc265c085607c196e0de1.png)  
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.

---

<div class="post-metadata">

**Author:** ![Ingo\_Richtsmeier](https://forum.camunda.io/user_avatar/forum.camunda.io/ingo_richtsmeier/32/25968_2.png) [@Ingo\_Richtsmeier](https://forum.camunda.io/u/Ingo_Richtsmeier)\
**Post date:** [March 8, 2023, 1:20pm UTC](https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083/2 "2023-03-08T13:20:35Z")

</div>

Hi @Cody_Newman,

you may have to use the generic properties to set the value: [Process Engine Configuration | docs.camunda.org](https://docs.camunda.org/manual/7.18/user-guide/spring-boot-integration/configuration/#generic-properties)

Hope this helps, Ingo

---

<div class="post-metadata">

**Author:** ![Cody\_Newman](https://forum.camunda.io/user_avatar/forum.camunda.io/cody_newman/32/21038_2.png) [@Cody\_Newman](https://forum.camunda.io/u/Cody_Newman)\
**Post date:** [March 8, 2023, 2:31pm UTC](https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083/3 "2023-03-08T14:31:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cody\_Newman](https://forum.camunda.io/user_avatar/forum.camunda.io/cody_newman/32/21038_2.png) [@Cody\_Newman](https://forum.camunda.io/u/Cody_Newman)\
**Post date:** [March 14, 2023, 11:15am UTC](https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083/4 "2023-03-14T11:15:03Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Ingo\_Richtsmeier](https://forum.camunda.io/user_avatar/forum.camunda.io/ingo_richtsmeier/32/25968_2.png) [@Ingo\_Richtsmeier](https://forum.camunda.io/u/Ingo_Richtsmeier)\
**Post date:** [March 14, 2023, 12:54pm UTC](https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083/5 "2023-03-14T12:54:14Z")

</div>

Hi @Cody_Newman,

I cannot reproduce this, it works on my machine.

With your settings, the logs say:

```auto
[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:

```auto
[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:

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

```

Hope this helps, Ingo

---

<div class="post-metadata">

**Author:** ![Cody\_Newman](https://forum.camunda.io/user_avatar/forum.camunda.io/cody_newman/32/21038_2.png) [@Cody\_Newman](https://forum.camunda.io/u/Cody_Newman)\
**Post date:** [March 14, 2023, 1:52pm UTC](https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083/6 "2023-03-14T13:52:34Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 31, 2024, 10:42am UTC](https://forum.camunda.io/t/job-executor-priority-by-due-date-missing/43083/7 "2024-01-31T10:42:38Z")

</div>

Closed on January 31, 2024, 10:42am UTC


