Did this blog help you solve a problem? Tip me with Bitcoins at: 17dQktcAmU4urXz7tGk2sbuiCqykm3WLs6

Friday, September 10, 2010

Quartz Jobs.xml Example - Adding a Durable Job

The following sample XML shows how to set up a single Quartz job without a trigger in a jobs.xml configuration file. I first tried just creating a job without any trigger associated with it, but I got a runtime error:

Error scheduling jobs: A new job defined without any triggers must be durable...A new job defined without any triggers must be durable...

The following scheduled job is called SampleJob. The one tricky catch is that in order to set the job as durable, you also have to include the volatility AND recover elements. This works for sure with Quartz version 1.8.3.

<?xml version='1.0' encoding='utf-8'?>
<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
  xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"


Piece of Cake!!!

No comments: