Skip to content

MikesGlitch/ServiceStackQuartz

Repository files navigation

This package is no longer maintained

ServiceStackWithQuartz Build status

ServiceStack.Funq.Quartz allows an easy registration of all Quartz Jobs within ServiceStack's Funq container. This allows for dependency injection within any Quartz Job.

This repository goes alongside my blog post here: [Creating a ServiceStack Windows Service that uses Quartz] (http://michaelclark.tech/2016/04/16/creating-a-servicestack-windows-service-that-uses-quartz/)

You can install this package via Nuget with: install-package ServiceStack.Funq.Quartz

##How to use Register your jobs with the Funq container by calling the RegisterQuartzJobs with the assembly that contains your Jobs:

    //// Add the using
    using ServiceStack.Funq.Quartz;

    //// This method scans the assembly for the Jobs
    container.RegisterQuartzScheduler(typeof(HelloJob));
    
    //// Resolve the Quartz Scheduler as normal
    var scheduler = container.Resolve<IScheduler>();
    
    //// Start Quartz Scheduler
    scheduler.Start();

Advanced Configuration

There is also support for Quartz Configuration ("Configuration" section):

    var quartzConfig = new NameValueCollection();
    properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
    properties["quartz.threadPool.threadCount"] = "5";
    properties["quartz.threadPool.threadPriority"] = "Normal";
    
    container.RegisterQuartzScheduler(typeof(HelloJob), quartzConfig);

Previously asked questions: Resolving a Service with nothing in it

ServiceStack You can find the ServiceStack framework here: https://github.com/ServiceStack/ServiceStack

About

Built to allow easy Quartz setup within ServiceStack.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published