Spring quartz / cron jobs in a distributed environment

I have approximately 5 servers. I want to run an identical Spring / Tomcat application on each machine.

I also need a separate task that will be performed every ten minutes. It should work only on one of the machines. I need some kind of election protocol or other similar solution.

Does Spring or quartz have any built-in distributed cron solution, or do I need to implement something?

+8
spring quartz-scheduler
source share
2 answers

See the Cluster Configuration for Quartz documentation.

+9
source share

Hazelcast has a distributed performer structure that you can use to run tasks using the JDK Executor infrastructure (which, by the way, is perhaps more verifiable than the awful Quartz ... maybe). It has several modes of operation, including the ability to select one instance of a node "randomly" to do your work.

See the documentation for more details.

+2
source share

All Articles