To achieve multitenant behavior for quartz scheduler, we need to setup:
- set tenantId for every job we created.. we use quartz
JobDataMap
(handy key/value store) in Job class JobListener
- to inject tenantId from JobDataMap into current thread-bounded tenant context
This will work with shared quartz database.. if we want to have separated quartz databases/schemas for every tenant, we can instantiate multiple SchedulerFactoryBean with its custom dataSource
How would multi Instantiation for SchedulerFactoryBean with custom dataSource look like?