Domla.Quartz.RavenJobStore 1.0.0

dotnet add package Domla.Quartz.RavenJobStore --version 1.0.0
NuGet\Install-Package Domla.Quartz.RavenJobStore -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Domla.Quartz.RavenJobStore" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Domla.Quartz.RavenJobStore --version 1.0.0
#r "nuget: Domla.Quartz.RavenJobStore, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Domla.Quartz.RavenJobStore as a Cake Addin
#addin nuget:?package=Domla.Quartz.RavenJobStore&version=1.0.0

// Install Domla.Quartz.RavenJobStore as a Cake Tool
#tool nuget:?package=Domla.Quartz.RavenJobStore&version=1.0.0

build and test

Qodana

Quartz.NET-RavenJobStore

JobStore implementation for Quartz.NET scheduler using RavenDB.<br> Not exactly a fork of, but inspired by Quartz.NET-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 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).

Project goals

  • Can handle high volumes of jobs and triggers.
  • Suitable for clustered schedulers.
  • Different schedulers (instance names) can share the same database.

How to get started

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

You can either let the package create a IDocumentStore on its own:


using Domla.Quartz.Raven;
using Quartz;
using Quartz.Impl.RavenStore.Example;
using Raven.Client.Documents;
using Raven.Client.Documents.Conventions;

CreateFromProperties().Run();

IHost CreateFromProperties() =>
    Host.CreateDefaultBuilder(args)
        .ConfigureServices(services =>
        {
            services.AddHostedService<Worker>();

            services.AddQuartz(quartz =>
            {
                // Quartz insists on selecting a serializer. 
                quartz.SetProperty("quartz.serializer.type", "binary");

                // Configure thread pool size for Quartz,
                // not directly to RavenJobStore.
                quartz.UseDefaultThreadPool(pool => pool.MaxConcurrency = 10);

                quartz.UsePersistentStore(store =>
                {
                    // Tell Quartz to use RavenJobStore as store backend,
                    // creating a DocumentStore along the way.
                    store.UseRavenDb(configuration =>
                    {
                        // To run this demo you need to have running RavenDB at http://localhost:8080.
                        // Or use a different URL which suits your needs.
                        configuration.Urls = new[] { "http://localhost:8080" };

                        // The database is expected to be created.
                        configuration.Database = "QuartzDemo";

                        // Time to wait for non-stale query results.
                        configuration.SecondsToWaitForIndexing = 15; // default

                        // How often to retry an operation when failed because of a concurrency exception.
                        configuration.ConcurrencyErrorRetries = 100; // default

                        // Just for the record - you can prefix the collection 
                        // names for our classes with a common name.
                        // configuration.CollectionName = "Name";

                        // Path to a raven client certificate
                        // configuration.CertPath = "certificate.pem";

                        // Password for the certificate.
                        // configuration.CertPass = "secret-password";
                    });
                });
            });
            services.AddQuartzHostedService(quartz => quartz.WaitForJobsToComplete = true);
        })
        .Build();

or you can create and configure your own IDocumentStore and let the JobStore use it:


using Domla.Quartz.Raven;
using Quartz;
using Quartz.Impl.RavenStore.Example;
using Raven.Client.Documents;
using Raven.Client.Documents.Conventions;

CreateWithOwnDocumentStore().Run();

IHost CreateWithOwnDocumentStore() =>
    Host.CreateDefaultBuilder(args)
        .ConfigureServices(services =>
        {
            // Build and register a Raven document store as usual.
            var conventions = new DocumentConventions
            {
                UseOptimisticConcurrency = true
            };
            var documentStore = new DocumentStore
            {
                Conventions = conventions,
                // To run this demo you need to have running RavenDB at http://localhost:8080.
                // Or use a different URL which suits your needs.
                Urls = new[] { "http://localhost:8080" },
                    
                // The database is expected to be created.
                Database = "QuartzDemo"
            };

            documentStore.Initialize();

            services.AddSingleton<IDocumentStore>(documentStore);

            services.AddHostedService<Worker>();

            services.AddQuartz(quartz =>
            {
                // Quartz insists on selecting a serializer. 
                quartz.SetProperty("quartz.serializer.type", "binary");

                // Configure thread pool size for Quartz,
                // not directly to RavenJobStore.
                quartz.UseDefaultThreadPool(pool => pool.MaxConcurrency = 10);

                // Yes, it is that simple.
                quartz.UsePersistentStore(store => store.UseRavenDb(services));
            });

            services.AddQuartzHostedService(quartz => quartz.WaitForJobsToComplete = true);
        })
        .Build()
        .UseRavenJobStoreLogging();

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 188 12/18/2023

* 1.0.0
First official release.

* 1.0-beta.4
Use block repository to perform the clear correctly.

* 1.0-beta.3
Uses in-memory blocks for non-clustered schedulers to improve performance.

* 1.0 - beta.2
Waiting for indexes before streaming seems to be a performance killer - try to wait only for the needed index(es).

* 1.0 - beta.1
Fixes an orphaned job block bug which occured with self removing jobs. This is the first release candidate.

* 0.9
Fixes a bug which sets a trigger to be blocked unexpectedly.

* 0.8
Fixes a bug occuring when a non concurrent job re-schedules itself.

* 0.7
Fixes two bugs related to deleting completed triggers and jobs.