How to customize the jobexecutor

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2012 11:59 PM
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).
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).
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2013 04:35 AM
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.
