Reddoxx.Quartz.MongoDbJobStore 1.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Reddoxx.Quartz.MongoDbJobStore --version 1.0.0
NuGet\Install-Package Reddoxx.Quartz.MongoDbJobStore -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="Reddoxx.Quartz.MongoDbJobStore" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Reddoxx.Quartz.MongoDbJobStore --version 1.0.0
#r "nuget: Reddoxx.Quartz.MongoDbJobStore, 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 Reddoxx.Quartz.MongoDbJobStore as a Cake Addin
#addin nuget:?package=Reddoxx.Quartz.MongoDbJobStore&version=1.0.0

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

MongoDB Job Store for Quartz.NET

Thanks to @chrisdrobison for handing over this project.

Nuget

Install-Package Quartz.Spi.MongoJobStore

Basic Usage

To use the MongoDb job-store you need to add your custom IMongoDbJobStoreConnectionFactory to the DI-container and configure the UsePersistentStore with MongoDbJobStore.

    // MongoDb connection factory
    services.AddSingleton<IMongoDbJobStoreConnectionFactory, LocalMongoDbJobStoreConnectionFactory>();

    services.AddQuartz(
        q =>
        {
            q.SchedulerId = "AUTO";

            q.UsePersistentStore<MongoDbJobStore>(
                storage =>
                {
                    storage.UseClustering();
            
                    // Enable json serializers (required)
                    storage.UseNewtonsoftJsonSerializer();
    
                    storage.ConfigureMongoDb(
                        c =>
                        {
                            // Configure your custom collection prefix
                            c.CollectionPrefix = "CustomPrefix";
                        }
                    );
                }
            );
        }
    );

The connection factory is required to return the database instance for your collections.

internal class LocalMongoDbJobStoreConnectionFactory : IMongoDbJobStoreConnectionFactory
{
    private const string LocalConnectionString = "mongodb://localhost/quartz?minPoolSize=16&maxConnecting=32";

    private readonly IMongoDatabase _database;

    public LocalMongoDbJobStoreConnectionFactory()
    {
        var url = new MongoUrl(LocalConnectionString);
        var client = new MongoClient(url);

        _database = client.GetDatabase(url.DatabaseName);
    }

    public IMongoDatabase GetDatabase()
    {
        return _database;
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on Reddoxx.Quartz.MongoDbJobStore:

Package Downloads
Reddoxx.Quartz.MongoDbJobStore.Redlock The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Redlock locking support for quartz-mongodb-job-store

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.2 668 2/28/2024
1.2.1 104 2/26/2024
1.1.4 119 2/21/2024
1.1.2 130 2/13/2024
1.1.0 100 2/13/2024
1.0.0 133 2/2/2024