Giter VIP home page Giter VIP logo

r.scheduler's Introduction

Version 1.2.4 adds support for:

  • Token-based authentication (No default implementation provided, you must implement R.Scheduler.Interfaces.IAuthorize in your custom assembly and register the assembly with the Scheduler at start-up. See R.Scheduler.TestHost.Program.cs)
  • ConnectionString encryption for SqlJob and username/password encryption for FtpDownloadJob. (Add <add key="FeatureToggle.EncryptionFeatureToggle" value="true" /> and <add key="SchedulerEncryptionKey" value="{Convert.ToBase64String(R.Scheduler.Core.AESGCM.NewKey())}" /> to your app settings.

R.Scheduler

An experimental, easy to use job execution engine built on top of Quartz Enterprise Scheduler .NET. R.Scheduler is API driven. Actions can be performed using a simple RESTful API using JSON over HTTP.

Project Maturity

R.Scheduler is used in a production environment with a couple of thousands of jobs running daily. It is relatively matured but may not yet be suitable for the most demanding and conservative projects.

Public (Web) API is relatively stable but minor changes are likely in future versions.

Getting Started

Setup Database

Create a set of database tables for Quartz.NET. Use table-creation SQL scripts in
https://github.com/R-Suite/R.Scheduler/blob/master/database/quartz/tables_postgres.sql or
https://github.com/R-Suite/R.Scheduler/blob/master/database/quartz/tables_sqlServer.sql

Create a set of database tables for R.Scheduler. Use table-creation SQL scripts in
https://github.com/R-Suite/R.Scheduler/blob/master/database/rscheduler/tables_postgres.sql or
https://github.com/R-Suite/R.Scheduler/blob/master/database/rscheduler/tables_sqlServer.sql

Simple Configuration

Calling initialize with no parameters will create and start an instance of the Scheduler with default configuration options.

public class Program
{
    private static void Main(string[] args)
    {
        R.Scheduler.Scheduler.Initialize();
    }
}

Custom Configuration

Initialize also takes a single lambda/action parameter for custom configuration. In this case we choose not to start the Scheduler automatically. Instead, we create a scheduler instance and start the instance explicitly after the Scheduler initialization.

public class Program
{
    private static void Main(string[] args)
    {
        R.Scheduler.Scheduler.Initialize(config =>
        {
            config.AutoStart = false;
            config.CustomFtpLibraryAssemblyName = "MyFtpLib.dll";
            config.PersistanceStoreType = PersistanceStoreType.Postgre;
            config.ConnectionString = "Server=localhost;Port=5432;Database=Scheduler;User Id=xxx;Password=xxx;";
        });

        IScheduler sched = R.Scheduler.Scheduler.Instance();
        sched.Start();
    }
}

Create New [WebRequest] Job

POST /api/webRequests
{
    "JobName": "MyJob",
    "ActionType": "HTTP",
    "Method": "POST",
    "Uri": "http://localhost:6001/api/myEndpoint",
    "Body": "",
    "ContentType": "application/json"
}

The result of the above operation is:

{
    "Id": "207379FE-9F7F-483C-8D26-A5369F073369",
    "Valid": "True",
    "Errors": []
}

Get Job

GET /api/jobs/207379FE-9F7F-483C-8D26-A5369F073369

The result of the above operation is:

{
    "Id": "207379FE-9F7F-483C-8D26-A5369F073369",
    "JobName": "MyJob",
    "JobGroup": "DEFAULT",
    "JobType": "WebRequestJob",
    "Description": ""
}

Schedule Job with Simple Trigger

POST /api/simpleTriggers
{
    "Name": "MyTrigger",
    "JobName": "MyJob",
    "RepeatCount": 5,
    "RepeatInterval": "0:00:01:00"
}

{
    "Id": "C0BD2811-6AD5-4120-90F2-900AA668FDCC",
    "Valid": "True",
    "Errors": []
}

Execute Job

POST /api/jobs/207379FE-9F7F-483C-8D26-A5369F073369
{}

{
    "Valid": "True",
}

Delete Job

DELETE /api/jobs/207379FE-9F7F-483C-8D26-A5369F073369
{}

Supported Quartz.net Functionality

  • Jobs:
    • SendMailJob
    • NativeJob
    • DirectoryScanJob (with callback url parameter)
  • Triggers:
    • Simple Trigger
    • Cron Trigger
  • Calendars:
    • Holiday Calendar
    • Cron Calendar
  • Misfire Instructions
  • DataStore:
    • SqlServer
    • Postgres

What does R.Scheduler add on top of top of Quartz.net?

  • Jobs:
    • AssemblyPluginJob
    • FtpDownloadJob (Use Default Ftp library or inject your own)
    • WebRequestJob
    • DirectoryScanJob callback
    • SqlJob
  • WebApi
  • Auditing
  • Support for Token-based authentication

Downloads

Download from NuGet 'R.Scheduler' and install into your Host application.

Download from NuGet 'R.Scheduler.Contracts' and install into your Client application(s).

Search NuGet for R.Scheduler

r.scheduler's People

Contributors

jpachansky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.