Dashboard > Terracotta Forge Labs > Quartz
  Terracotta Forge Labs Log In   View a printable version of the current page.  
  Quartz
Added by Nitin Jain, last edited by Alex Miller on Apr 14, 2008  (view change)
Labels: 
(None)

Overview

Quartz is a open source job scheduling system that can be integrated with, or used along side virtually any J2EE or J2SE application. Quartz can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components or EJBs.

Quartz terracotta integration enables Quartz clustering based on RAMJobStore. Compared to existing JobStoreTx or JobStoreCMT DB based clustering, Terracotta based RAMJobStore clustering is much more efficient and easy to configure.

Configuration Module

The quickest and easiest way to cluster Quartz is to include Quartz Configuration Module in your Terracotta XML configuration. Just download the following jar file: clustered-quartz-5.1-1.0.0.jar and add it in your configuration like this:

<clients>
    <modules>
         <repository>./modules</repository>
         <module name="clustered-quartz-5.1" version="1.0.0"/> 
    </modules>
  </clients>
Module Location

Make sure that the modules are located in the correct location. The location of the modules is specified in the <repository> element. The easiest way is to copy all the module jars in the TC_INSTALL_DIR/modules directory and you do not need to specify the <repository> element. If you chose to keep the modules in a custom location, you should specify the correct location in the <repository> element. E.g. The above example assumes the modules to be in the modules sub-directory under the current directory.

Module name

Note that there is a correlation between the module jar file-name and the module element in the configuration. The jar file-name follows the pattern modulename-version.

Here is further documentation on configuration modules: Configuration Modules

What is supported

1. RAMJobStore is clustered.
2. Jobs executions is load balanced across cluster nodes. Each Scheduler instance in the cluster attempts to fire scheduled triggers as fast as the Scheduler permits. The Scheduler instances compete for the right to execute a job by firing its trigger. When a trigger for a job has been fired, no other Scheduler will attempt to fire that particular trigger until the next scheduled firing time.
3. Recovery from failed scheduler instances. When a Scheduler instance fails terracotta detects it immediately and Jobs are recovered to execute by another scheduler at their next execution time.
4. Jobs are triggers information survives nodes' failure. If Terracotta server is configured to run in persistent mode, information is maintained across server restart.

What is not supported

Recoverable jobs are not executed immediately. Instead if their scheduler fails, they are executed by another scheduler instance in the cluster at their next execution time.

Comparison with DB based clustering from Quartz

1) It is much faster as everything works in RAM (as compared to DB approach used in JobStoreTx and JobStoreCMT). Terracotta field level changes makes changes to Job and Triggers lightening fast.
2) Hassle free. No DB setup is required.
3) Failed jobs are recovered immediately as compared to DB based approach where scheduler instance are checked for failure based on an interval.
4) No Jgroups or any other cluster configuration is required.

Public Source Repository

SVN: http://svn.terracotta.org/svn/forge/projects/labs/quartz-5.1

Private Source Repository (for committers)

SVN: https://svn.terracotta.org/svn/forge/projects/labs/quartz-5.1

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators