Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 2.33 KB

readme.markdown

File metadata and controls

45 lines (34 loc) · 2.33 KB

Quartz.NET-MongoDB

Overview

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

This provider enables MongoDB to be used as the back-end job store via the Official 10gen provider. Hugely inspired by the Elmah-MongoDB project. It is an adaptation of the original "RAMJobStore" with custom BSON serializers.

Usage

The easiest way to add this to a project is via the quartz.impl.mongodb NuGET package which will add the required assemblies to your project.

Configuration

Here is an example web or app config file snippet:

<quartz>
  <add key="quartz.jobStore.type" value="Quartz.Impl.MongoDB.JobStore, Quartz.Impl.MongoDB"/>
</quartz>
<connectionStrings>
  <add name="quartznet-mongodb" connectionString="server=localhost;database=quartznet;"/>
</connectionStrings>

You may want to use the in-code method to configure your scheduler as it is easier in a clustered environment. Remember this will still need to set a valid connection string in web or app config file :

// get a scheduler
NameValueCollection properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "MyApplicationScheduler"; // needed if you plan to use the same database for many schedulers
properties["quartz.scheduler.instanceId"] = System.Environment.MachineName + DateTime.UtcNow.Ticks; // requires uniqueness
properties["quartz.jobStore.type"] = "Quartz.Impl.MongoDB.JobStore, Quartz.Impl.MongoDB";

IScheduler scheduler = new Quartz.Impl.StdSchedulerFactory(properties).GetScheduler();

Changes in version 1.3

  • Updated NuGet dependencies to Quartz 2.1.2 and MongoCSharpDriver 1.7
  • Fixes DailyIntervalTrigger serialization

Changes in version 1.2

  • Updated NuGet dependencies to Quartz 2.0.1 and MongoCSharpDriver 1.5

Changes in version 1.1

  • Respects trigger priority
  • Serializes DateTimeOffset as MongoDB ISODate
  • Fixes DailyCalendar time range exclusion
  • Improves clustered concurrency and large trigger collection management