02-10-2017 10:47 AM
Hi,
i've got a question about configurate the async executor.
I've setup a Process Engine with my own async executor with this code:
ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
DefaultAsyncJobExecutor asyncExecutor = new DefaultAsyncJobExecutor();
asyncExecutor.setCorePoolSize(10);
asyncExecutor.setMaxAsyncJobsDuePerAcquisition(5);
asyncExecutor.setMaxPoolSize(50);
processEngineConfiguration.setAsyncExecutor(asyncExecutor);
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
Later when i run my process it seems like my async executor is not used. There are just two threads used which leeds to the assumption that activiti uses still the default async executor with a default corePoolSize of 2.
Another try was this code:
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
with the activiti.cfg.xml i uploaded. Same problem. Just two threads are working.
Can someone help me with this?
Greetings and Thanks
02-10-2017 11:20 AM
It doesn't look like you have enabled the AsyncExecutor:
processEngineConfiguration.setAsyncExecutorEnabled(true);
processEngineConfiguration.setAsyncExecutorActivate(true);
I believe you will need both of these in order to override the default job executor.
You should be able to tell from the logs.
Greg
02-10-2017 11:20 AM
It doesn't look like you have enabled the AsyncExecutor:
processEngineConfiguration.setAsyncExecutorEnabled(true);
processEngineConfiguration.setAsyncExecutorActivate(true);
I believe you will need both of these in order to override the default job executor.
You should be able to tell from the logs.
Greg
02-11-2017 07:29 AM
Yep. This worked. Thank you very much!
Now i have another question. Before it worked i started the process in eclipse and i saw it on the log in tomcat/wildfly. Now it seems that the process is executed in eclipse supported by the activiti libraries and independent from the engine i deployed on the application server. In fact the application server does not even have to run for executing my process now... That's not the scenario i want. Actually i want to have a jar and bar deployment on an application server like tomcat or wildfly and the process should be executed from a async executor which was configurated by me on the server.
Is this possible?
I hope this makes sense. It is not for a productive system. I want an comparison between different bpms for my study and activti has now an execution witch is different and therefore not comparable...
So as a question: How can i alter or configure the async executor which is used from the engine which is deployed on a tomcat with the activiti-explorer.war?
02-13-2017 11:07 AM
HI Jürgen Krauß ,
How can i alter or configure the async executor which is used from the engine which is deployed on a tomcat with the activiti-explorer.war?
I believe your question has been asked and answered by the following threads:
- Suggested by Joram: How build activiti-explorer sources to file war , basically just clone the code, change it and rebuild with Maven.
- Another approach by gregdavisfromnj _ : , this is more advanced approach with Maven Overlays.
Hope this helps,
Thanks,
Thong Huynh
02-13-2017 11:50 AM
Yep ok. Thanks. I thought about that. Hoped there would be another way then alter the code by itself and build my own warfile. Something like a config file or something. I will look into this.
02-20-2017 12:15 PM
I tried this now.
I cloned the project from git and changed the variables in DefaultAsyncJobExecutor in package org.activiti.impl.asyncexecutor tor following:
/** The minimal number of threads that are kept alive in the threadpool for job execution */
protected int corePoolSize = 10;
/** The maximum number of threads that are kept alive in the threadpool for job execution */
protected int maxPoolSize = 10;
/** The size of the queue on which jobs to be executed are placed */
protected int queueSize = 100;
If i deploy the new warfile and start the server the console says:
Creating executor service with corePoolSize 2...
Is there another location where the software can pull that 2 for corePoolSize from?
02-20-2017 12:22 PM
02-20-2017 12:55 PM
Yay. It worked. Why is the configuration in DefaultAsyncJobExecutor.java existing?
Think i'm finished now with Activiti. 🙂
Thanks a lot to Greg Harley and Thong Huynh. You guys gave me a great guidance for my work.
02-20-2017 03:09 PM
No worries Jurgen. I thin the defaults are listed in the DefaultAsyncJobExecutor.java class just in case you forget to configure the properties in the engine.
Glad you got it working.
Greg
Explore our Alfresco products with the links below. Use labels to filter content by product module.