Interruption of work in a quartz cluster

I have a Quartz setup with multiple instances, and I want to interrupt work where it runs. As the documentation said, the Scheduler.interrupt() method is not a cluster, so I'm looking for some common practice to overcome this limitation.

+7
source share
1 answer

Well, here are some basics you should use to achieve this.

When working in cluster mode, information on current tasks in progress is available in quartz tables. For example, q_fired_triggers contains a job in q_fired_triggers . The first column of this table is the name of the scheduler responsible for this. Therefore, it’s pretty easy to find out who does what.

Then, if you enable the JMX export of your quartz instances of org.quartz.scheduler.jmx.export , MBeans, you enable a new entry point for remote control of each scheduler individually. MBean provides a boolean interruptJob("JobName", "JobGroup") method boolean interruptJob("JobName", "JobGroup")

Then you just need to call this method on the appropriate scheduler instance to interrupt it effectively.

I tried the whole process manually and it works great, just need to automate :)

E.I.V.

+2
source

All Articles