Hi all,
I’m using Flowable 6.2.1 with flowable-task installed as a web application and using PostgreSQL as the database. I have a very simple test process definition containing only one service task (which is defined as async). My custom java code (JavaDelegate implementation) is working properly. When I start 1000 process instances using the API, they all get process ınstance ids and async job executor starts processing them. However, it starts with only 2 threads (as expected by the default values) and does not increase the thread count although there are about 1000 async jobs waiting in ACT_RU_JOB table (some has locks and expire times and some or not). As I see in the documents, the default max thread pool size is 10 but I never see third thread starting, only two are working till all process instances are complete.
I tried changing pool parameters by adding these to the “flowable-ui-app.properties”:
I know this topic is quite old, but I came upon the same issue with Spring Boot.
According to docs - properties you mentioned (asyncExecutorCorePoolSize, …) should be available to override via setters on ProcessEngineConfigurationImpl.
It looks like that there is an issue when you start Flowable with default Spring configuration:
SpringAsyncExecutor#initAsyncJobExecutionThreadPool method has an empty body, so it’s Spring task executor used
FlowableJobConfiguration provides TaskExecutor with fixed core pool size. Currently, this property is set to 2.
There is a pretty easy workaround. Just provide custom task executor bean in your app, i.e.:
It looks quite tricky but works, and there is a small inconsistency between code and docs. Maybe there is missing info in docs that those properties work with standalone process engine and with Spring you should use those I’ve pasted above.
The link you referenced is correct when you are not using Spring Boot (maybe we need to stress that out in that section of the documentation).
Looking more into the code and the auto configuration. Seems like the properties that you mentioned would have no effect as the SpringAsyncExecutor does not use them, but uses the TaskExecutor that is provided by the FlowableJobConfiguration.
The way to change the Spring Task Executor is to provide your own and the one from Flowable won’t kick in. The reason why we did it like this is that we would have needed to do a lot of customizations, and we knew that Spring Boot 2.1 will have an auto configuration for the task executor, so we did a temporary solution like it is now.
Did you try using the properties you mentioned? Did it work?
Thank you for your quick response.
Regarding those properties, I’ve used them and it works (I see in logs that there are more threads). I think it works because there is
Hi @rgorzkowski@filiphr -
I am working with flowable 6.4.0 and need to change the property asyncExecutorMaxPoolSize. The application is running in tomcat 8.5 container. I’ve added application.properties file to tomcat’s lib directory with the following entry:
flowable.process.async.executor.asyncExecutorMaxPoolSize=20
or
flowable.process.async.executor.max-pool-size=20
A few questions:
Is application.properties file the right file ?
Which one of the above property is correct ? If neither, what is the right key ?
Is there a way to confirm that the property has been applied ?
Is there any log entry which will confirm the above ?
Is there any documentation for all all the spring property configurations keys ?
The configuration of the thread pools when using the OSS starters needs to be done with the spring.task.execution properties.
So to increase the max pool size you will need to set spring.task.execution.pool.max-size.
I would also reading this before setting the properties. The crucial part is:
If there are more than corePoolSize but less than maximumPoolSize threads running, a new thread will be created only if the queue is full.
So the max pool size will only be reached when the queue is full. And the default for Spring Boot 2.3 is unbounded, which means that the max-size property is ignored.
I have a spring boot application using Flowable. Overriding taskExecutor works (I do not know why) in 6.4 but in 6.5 the app fails to start saying:
APPLICATION FAILED TO STARTDescription:The bean ‘taskExecutor’, defined in class path resource [org/flowable/spring/boot/FlowableJobConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [SOME PATH TO RESOURCE IN MY PROJECT] and overriding is disabled.Action:Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
After looking some forums I learnt that @ConditionalOnMissingBean annotation used in org.flowable.spring.boot.FlowableJobConfiguration is probably ignored by spring boot because it only works when the class is declared as auto-configuration in spring.factories which is not the case.
I finished by setting spring.main.allow-bean-definition-overriding to true to be able to upgrade and as of now have not yet come up with a better solution.