cancel
Showing results for 
Search instead for 
Did you mean: 

How to customize the jobexecutor

arunpjohny
Champ in-the-making
Champ in-the-making
I'm working on a multi-tenant application which make use of spring `UserCredentialsDataSourceAdapter`, so that each tenant will have an independent database.
I also have independent processEngine for each tenant.

Since there are lot of tenants(500+) and each tenant have its own processEngine there are lot of jobExecutors active in the application, which is causing a performance bottleneck for us. All I want to do is throttle the jobExecutors using an already existing mechanism.

Instead of the jobExecutor running self in every x seconds, I want to trigger the jobExecutor externally using some custom logic(it will take care of throttling).

How can I achieve this?

One of the way I'm looking at is to get hold of the the commandExecutor from the processEngine (using reflection) and then run the AcquireJobsCmd command to get the pending jobs then call the ExecuteJobsRunnable with appropriate parameters (I cannot use the default ExecuteJobsRunnable since it uses a `JobExecutor` and I don't have one).
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
The whole JobExecutor is pluggable: you can inject your own class (or extension of the default one) in the process engine configuration. That way, you have full control of which logic gets executed when and how.