Configuring the job executor

The job executor exposes a few properties you can tune. To change any of the values described below, edit the jbpm.job.executor bean in jbpm.cfg.xml. The role of the job executor is described with great detail in the section called “The job executor”.

Table 5.1. Job executor properties

PropertyDescriptionDefault
nbrOfThreadsSize of the job executor thread pool1
idleIntervalPeriod between checks for new jobs (milliseconds)5 seconds
maxIdleIntervalWhen a job fails, the affected thread pauses for a period initially equal to idleInterval, which is increased twofold until it reaches maxIdleInterval (milliseconds)1 hour
maxLockTimeAmount of time a job executor thread is allowed to hold a job before the job is released and offered to other threads (milliseconds)10 minutes
lockMonitorIntervalPeriod between checks for job lock times (milliseconds)1 minute

In addition to the job executor bean properties, you can indicate the number of times a failed job is retried. Set the jbpm.job.retries configuration entry to the desired value. The default is 3.

<int name="jbpm.job.retries" value="5" />

Caution

Setting the retry count to a low value may cause process instances to get stuck, whereas a high value causes jobs with unrecoverable exceptions (for instance, database connectivity problems) to be unduly reattempted.

Note

Alternate implementations of the message and timer service, such as the JCA inflow service included with JBoss ESB, also recognize the jbpm.job.retries configuration entry.