Job Executor Configuration

The job executor tag is used to configure the job executor and can be placed in the bpm-platform.xml file.

Example

The following example shows a job executor XML snippet:

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

Syntax Reference

Tag name Parent tag name Required? Description
<job-executor> <bpm-platform> true Container element for the configuration of a job executor.

Attributes: None.

Text Content: None.

<job-acquisition> <job-executor> true Specifies a job acquisition thread.

Attributes:

  • name: Defines the name of the job acquisition thread.

Text Content: None.

<job-executor-class> <job-acquisition> false Specifies the fully qualified classname of the job executor.

Attributes: None.

Text Content: None.

Example: <job-executor-class>org.camunda.bpm.example.MyJobExecutor</job-executor-class>

<properties> <job-acquisition> or <job-executor> false Container element for providing a set of thread configuration properties.

Attributes: None.

Text Content: None.

<property> <properties> false Set value for job acquisition configuration property.

Attributes:

  • name: The name of the property.

Text Content: The value of the property to be set.

Job-Executor Configuration Properties

The following is a list with the available job acquisition thread configuration properties, along with some explanations. The properties can be used in the <property name="foo">bar</property> tag, where foo is the name of the property and bar is the value of the property.

Limitation:

These properties only take effect in a Tomcat environment.

Property name Type Description
queueSize Integer Sets the size of the queue which is used for holding tasks to be executed.

Default Value: 3

corePoolSize Integer Sets the size of the core pool in the thread pool. This number of threads will always be present and wait to execute tasks.

Default Value: 3

maxPoolSize Integer Sets the maximum number of threads that can be present in the thread pool.

Default Value: 10

keepAliveTime Long Specify the time in milliseconds threads will be kept alive when there are no tasks present before threads are terminated until the core pool size is reached.

Default Value: 0

Job-Acquisition Configuration Properties

The following is a list with the available job acquisition thread configuration properties, along with some explanations. The properties can be used in the <property name="foo">bar</property> tag, where foo is the name of the property and bar is the value of the property.

Property name Type Description
maxJobsPerAcquisition Integer Sets the maximal number of jobs to be acquired at once.

Default Value: 3

lockTimeInMillis Integer Specifies the time in milliseconds an acquired job is locked for execution. During that time, no other job executor can acquire the job.

Default Value: 300000

waitTimeInMillis Integer Specifies the wait time of the job acquisition thread in milliseconds in case there are less jobs available for execution than requested during acquisition. If this is repeatedly the case, the wait time is increased exponentially by the factor waitIncreaseFactor. The wait time is capped by maxWait.

Default Value: 5000

maxWait Long Specifies the maximum wait time of the job acquisition thread in milliseconds in case there are less jobs available for execution than requested during acquisition.

Default Value: 60000

backoffTimeInMillis Integer Specifies the wait time of the job acquisition thread in milliseconds in case jobs were acquired but could not be locked. This condition indicates that there are other job acquisition threads acquiring jobs in parallel. If this is repeatedly the case, the backoff time is increased exponentially by the factor waitIncreaseFactor. The time is capped by maxBackoff. With every increase in backoff time, the number of jobs acquired increases by waitIncreaseFactor as well.

Default Value: 0

maxBackoff Long Specifies the maximum wait time of the job acquisition thread in milliseconds in case jobs were acquired but could not be locked.

Default Value: 0

backoffDecreaseThreshold Integer Specifies the number of successful job acquisition cycles without a job locking failure before the backoff time is decreased again. In that case, the backoff time is reduced by waitIncreaseFactor.

Default Value: 100

waitIncreaseFactor Float Specifies the factor by which wait and backoff time are increased in case their activation conditions are repeatedly met.

Default Value: 2

On this Page: