Job Executor activated despite setting jobExecutorActivate to false

Hi everyone, I would like to start the Job Executor after we have ensured that all the components are ready.

I tried setting jobExecutorActivate to ‘false’, so I can start it in a later event:

public class ProcessEngineConfig extends AbstractProcessEnginePlugin {

    @Override
    public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
        processEngineConfiguration.setJobExecutorActivate(false);
    }
}

This has stopped the Job Executor from activating immediately after Process Engine has started.

However, the Job Executor is still getting started by itself when it receives the ApplicationReadyEvent.
The ApplicationReadyEvent seems to have activated the Job Executor in JobExecutorStartingEventListener that is listening to ProcessApplicationStartedEvent, which is being injected in DefaultJobConfiguration (https://github.com/camunda/camunda-bpm-spring-boot-starter/blob/master/starter/src/main/java/org/camunda/bpm/spring/boot/starter/configuration/impl/DefaultJobConfiguration.java#L124).

Is this the expected behaviour? Or am I missing something?

Thank you!

@tzehuai maybe its being overrided as you used it in preinit.
I had success using this property in my bootstrap.yml (or applcation.properties too):

camunda:
  bpm:
    job-execution:
      enabled: false

Thankss for the response.

So instead of setting it in PreInit, do you know whether it should be set elsewhere while still able to keep the camunda.bpm.job-execution.enabled=true to have the default JobExecutor?

If I were to set camunda.bpm.job-execution.enabled=false, I guess I will have to create my own CamundaJobConfiguration, am I right?

On a side note, I did find this old commit, having JobExecutorRunListener which has a jobExecutorActivate check before activating: https://github.com/camunda/camunda-bpm-spring-boot-starter/commit/377418277dce9635659330af73ca95ff9a9e42bd#diff-98fa4f1e5640d7f0e32519592e808ae2c1233e01e1085410316ca1988b88398d. But it doesn’t seem to be in use anymore.

On the other hand, the JobExecutorStartingEventListener doesn’t have a check on jobExecutorActivate before activating: https://github.com/camunda/camunda-bpm-spring-boot-starter/commit/377418277dce9635659330af73ca95ff9a9e42bd#diff-98fa4f1e5640d7f0e32519592e808ae2c1233e01e1085410316ca1988b88398d