Quartz Job Scheduler - Configuring Multiple Tenants

Since I didn't find anything related to what would lead me to inspiration, I thought I'd come up with this here.

I recently worked a lot with Quartz Job Scheduler , which I have already implemented in a RESTful Java Servlet which should offer Sencha ExtJS UI for creating jobs. We are using the Authenticator class in conjunction with the DatabaseManager, which takes care of authenticating users and all other data related to the database (using Hibernate).

Since we want to use it in the enterprise Java applications we develop, we need to run this task for each client. We also require the use of JobStoreTX for persistent data in MySQL databases (obviously for clustering), so the volatile RAMJobStore implementation is taboo. I know the official documentation and Quartz itself does not seem to support multiple tenant implementations (see Quartz Clustering ).

Our setup looks like this (simplified):
- 1+ Tomcat production (serving application logic)
- 1+ Apache production (serving ExtJS external and static content)
- n databases (one for each client)

To add something even more complex:
we have legacy client-centric modules (each client gets their own app hosting) and more modern modules are centralized with client-specific access.

In my opinion, it would not be enough to create quartz related tables in each customer database as we want to stick to a simple, straight forward setup (which means, for example, the same table prefix for each customer, etc.) so as not to complicate the deployment of quartz throughout the farm.

I already thought about combining it with MariaDB MaxScale and using filters to route Quartz to each client database based on RegEx or something similar, with Quartz only talking to MaxScale proxy, but that seemed a little too overhead for what I'm trying achieve and I'm not even sure if this will work at all.

Is there something that would give me multiple rentals with Quartz ? Could you please suggest an approach that would make Quartz be able to handle this since we need to run jobs for each client, but on a "single" Tomcat (which is actually grouped and balanced)? Or is there another product / framework / library that supports multiplayer out of the box?

Any guidance, idea or help is greatly appreciated!

+3


source to share


1 answer


Finally I got it to write to multiple databases.



What I did was create a Quartz properties file on the fly for each client based on the corresponding client settings, and forced the program logic to read this newly created file. So each client has their own Quartz jobs stored in their own database.

0


source







All Articles