0
votes

My application currently instantiates and starts a default scheduler during application startup using:

@Override
public void contextInitialized(ServletContextEvent arg0) {
    try {   
        Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
        scheduler.start();
    } catch (SchedulerException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

This logic runs on a cloud machine as well as on local development machines, and quartz.properties is currently set to non-clustering mode. The application is also using JDBC Job Store.

I'm concerned about having one scheduler instance for each machine- please give me recommendations on how to manage Quartz Scheduler on multiple machines. Does this use case require clustering?

I scheduled a test trigger to run every minute. While there haven't been duplicate job executions, I've noticed a few missed firings that were never counted as misfires.

1
can you elaborate your use case? Its not very clear from what you are describing. Does your use case need multiple instances to share the load by forming a cluster or you are just looking for persistence support? Do each of your node manage their own workload? - Srinivas
@Srinivas after playing around with different configurations, I've found a setup that works for the app. I'll write more about it in an answer below. - plsplox

1 Answers

0
votes

I played around with the configuration and settings, and found a setup that works for my application. The app servers serve web resources from a cluster configuration; my mistake was starting a non-clustered scheduler instance in each app server.

At the moment, I don't think this application needs multiple machines are needed to handle scheduled jobs just yet. Also, I haven't figured out how to synchronize system times on our cloud servers, which is a requirement for Quartz's clustering feature.

I ended up dedicating a single non-clustered machine that starts one scheduler instance. This configuration works as expected, and the odd bugs have disappeared (unacknowledged misfires, etc.).