Process Engine Configuration

Hi i am using an embedded process engine setup. I am also using spring configuration to bootstrap the process engine
spring-servlet.xml (4.4 KB)

I also want to modify the job executor properties like

    <property name="queueSize">3</property>
    <property name="corePoolSize">5</property>
    <property name="maxPoolSize">10</property>
    <property name="keepAliveTime">0</property>

How can i injcet these properties through spring config attached?

Create a bean of type org.camunda.bpm.engine.impl.jobexecutor.ThreadPoolJobExecutor and wire it with the engine configuration via property jobExecutor. Create a bean of type java.util.concurrent.ThreadPoolExecutor and wire it with the job executor via threadPoolExecutor. All those configuration properties apply to the thread pool executor, which you can instantiate and configure as you like.

Cheers,
Thorben

1 Like

Thanks @thorben

<constructor-arg index="0" type="int" value="${corePoolSize}"/>
<constructor-arg index="1" type="int" value="${maximumPoolSize}"/>
<constructor-arg index="2" type="long" value="${keepAliveTime}"/>
<constructor-arg index="3" type="java.util.concurrent.TimeUnit" value="java.util.concurrent.TimeUnit.SECONDS"/>
<constructor-arg index="4"  value=""/>
</bean>

When configuring the ThreadPoolExecutor, what is the default implementation of the BlockingQueue we need to use? It is the 4th argument in the constructor for the ThreadPoolExecutor

> <bean id="processEngineConfiguration"
> 		class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
> 		<property name="processEngineName" value="wemanprocessengine" />
> 		<property name="dataSource" ref="dataSource" />
> 		<property name="history" value="full" />
> 		<property name="transactionManager" ref="transactionManager" />
> 		<!-- <property name="databaseSchemaUpdate" value="true" /> -->
> 		<property name="jobExecutorActivate" value="true" />
> 		<property name="jobExecutorAcquireByPriority" value="true" />
> 		<property name="producePrioritizedJobs" value="true" />
> 		<property name="authorizationEnabled" value="true" />
> 		<property name="jobExecutorDeploymentAware" value="true" />
> 		<property name="deploymentResources" value="classpath*:*.bpmn" />
> 		<!-- <property name="jobExecutor" ref="jobexecutor" /> -->
> 
> 	</bean>
> 
> 	 <bean id="jobexecutor"
> 		class="org.camunda.bpm.engine.impl.jobexecutor.ThreadPoolJobExecutor">
> 		<property name="threadPoolExecutor" ref="theadPoolExecutor" />
> 	</bean>
> 	<bean id="theadPoolExecutor" class="java.util.concurrent.ThreadPoolExecutor">
> 		<constructor-arg index="0" type="int" value="${corePoolSize}" />
> 		<constructor-arg index="1" type="int" value="${maximumPoolSize}" />
> 		<constructor-arg index="2" type="long" value="${keepAliveTime}" />
> 		<constructor-arg index="3">
> 			 <value type="java.util.concurrent.TimeUnit">SECONDS</value>
> 			</constructor-arg>
> 		<constructor-arg index="4" ref="linkedBlockingQueue"/>
> 	</bean>
> 
>    <bean id="linkedBlockingQueue"  class="java.util.concurrent.LinkedBlockingQueue">
>    <constructor-arg index="0" type="int" value="${queuesize}"></constructor-arg>
>    </bean> 

Is this the correct way ? I was not sure of the implementation class of the BlockQueue Interface,

In the default settings what is the implementation class

@thorben
I have tried with this configuration , but the process engine doe snot start
Not sure what i am missing , Can you help with the same ?

Where does it stop?`What’s the exception and its stacktrace?

1 Like