Question

We are implementing web app where we are using Spring 3.x.x and Quartz 2.x.x. Web server is Tomcat 7.x.x. We have 3 servers. Quartz is clustered, so all these servers are using to run jobs. Everything works OK.
Now, we have to add new job which can be ran only on server "number 1" or server "number 2", but never on server "number-3". It is related with the fact that server "number 3" does not contain some libraries and tools which this job requires. I could not find out any solution.
How to configure Quartz that it can run job-X on server "number 1" or server "number 2", but never on server "number 3"? Server "number 3" can run another jobs normally.

Was it helpful?

Solution

This feature is not available in opensource version of quartz. But you can control where to run the job using Terracotta Quartz Where

Terracotta Quartz Where: Control not only when jobs run, but where

Terracotta Quartz Where (not included in open source versions of Quartz) is a feature that offers commercial Terracotta Quartz Scheduler customers the ability to control where jobs execute — based on machine name (user-defined node or node group) or machine resources (RAM, CPU or OS). For applications that take advantage of both Terracotta Quartz Scheduler and Terracotta BigMemory, Quartz Where lets you control where jobs execute based on the location of data in a distributed in-memory management platform.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top