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
Solved! Go to Solution.
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
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
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?
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
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.
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?
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.
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
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.