/quartznet-RavenDB

RavenDB JobStore support for Quartz.NET scheduler.

Primary LanguageC#Apache License 2.0Apache-2.0

Quartz.NET-RavenDB

JobStore implementation for Quartz.NET scheduler using RavenDB.

About

Quartz.NET is a full-featured, open source job scheduling system that can be used from smallest apps to large scale enterprise systems.

Quartz.NET on RavenDB is a new provider written for Quartz.NET which lets us use the RavenDB NoSQL database as the persistent Job Store for scheduling data (instead of the SQL solutions that are built-in Quartz.NET).

Release Notes
  • 1.0.6 - Fixed parsing of Connection String when ApiKey is missing
  • 1.0.5 - Fixed authentication problem when using ApiKey in the connection string
  • 1.0.4 - Fixed misfire handling bug causing jobs not to fire.
  • 1.0.3 - Fixed a bug causing jobs and triggers not to be deleted.
  • 1.0.2 - Removed C5 dependency & minor bug fixes.
  • 1.0.0 - Initial release.
Installation

First add scheduling to your app using Quartz.NET (example). Then install the NuGet package.

Manual configuration

In your code, where you would have normally configured Quartz to use a persistent job store, you must add the following configuration property:

quartz.jobStore.type = Quartz.Impl.RavenDB.RavenJobStore, Quartz.Impl.RavenDB

Also, the following configuration must be added to app.config or web.config (change the connection string according to your server url, database name and ApiKey).

  <connectionStrings>
    <add name="quartznet-ravendb" connectionString="Url=http://localhost:8080;DefaultDatabase=MyDatabaseName;ApiKey=MyKey/MySecret"/>
  </connectionStrings>
Usage:
// In your application where you want to setup the scheduler:
NameValueCollection properties = new NameValueCollection
{
	// Normal scheduler properties
	["quartz.scheduler.instanceName"] = "TestScheduler",
	["quartz.scheduler.instanceId"] = "instance_one",
	["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz",
	["quartz.threadPool.threadCount"] = "1",
	["quartz.threadPool.threadPriority"] = "Normal",
	
	// RavenDB JobStore property
	["quartz.jobStore.type"] = "Quartz.Impl.RavenDB.RavenJobStore, Quartz.Impl.RavenDB"
};

// Init scheduler with the desired configuration properties
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler scheduler = sf.GetScheduler();

You can also take a look at the following demo and you are more than welcome to contribute and make suggestions for improvements.