General Structure of Quartz.NET and How To Implement It

 

General Structure of Quartz.NET and How To Implement It

1. Simple job schedule structure

Simple job schedule graph_01

The demo structure about the graph above could be:

The most important snippets are in “Example.cs” file :

And “SimpleJob.cs” would like :

It will run while user delivery the “Run()” in “Example.cs”. And we would see she screen shot like this:

2. Remote job schedule structure

Remote job schedule graph_02

The Demo structure could dive into two parts, the one is the client and the other is the server. The demo structure should be:

The most important code snippets in “clientExample.cs” are:

Note: If you do not use DB to store the data of schedule you can comment out the content named “set db info”.

This line is used to set the instance name, it is costumed.

This part is used to set the thread info about the job. It should be set both client side and server side code.

If you plan to use DB as your persistent level to store the scheduler data the part above is very necessary, otherwise, you could get rid of it from your code.

The first line is to tell quartz that you are going to store your scheduler data into the DB through ADO.NET.

The second line of this part, tell the quartz that you would use the default method to store your schedule data into DB. Because ADO.NET is default method to store the data in Quartz.NET, so we use default as the property.

The third line tells the quartz that your table name prefix. E.g. If there is a table named QRTZTest_Hello”, through the ‘QRTZTest_’ prefix, quartz would find it while running.

The fourth line tells the connection string to access your DB where the scheduler data stored.

The last line tells quartz that the DB is MSSQL. Because now quartz supports many different DB, e.g. Oracle, MySQL, SQLite, MSSQL etc. so this property is important.

Note: All the properties above about DB, should be set in client demo and server demo when you use DB as the persistent level to store your schedule data.

These properties are used to set remote exporter. And in server, should set following properties for suite.

At last, all the jobs in server could be able to delivery by the method in client. Yes, you should start two instances when you debug it. Client instance first, and then the server instance.

And you can see the result in the server instance.

Note: You must add “TopShelf” namespace into the server code.

While if the DB has been used as persistent level. The scheduler data could be seen in the table like this:

Additionally, how to run the server as a service by “Topshelf”

1) Compile the server project.

2) Find the executable file produce by the first step

3) Then run cmd prompt as administrator and input the like this:

The executable file name could be replaced by any of yourselves.

4) At last you could find it has been installed in your Services:

 
 
 
标签: Quartz.Net

General Structure of Quartz.NET and How To Implement It的更多相关文章

  1. Navigation - How to define the structure of the navigation tree via the NavigationItemAttribute

    In the meantime, you should use the Model Editor to create such a navigation structure. There are se ...

  2. 170. Two Sum III - Data structure design【easy】

    170. Two Sum III - Data structure design[easy] Design and implement a TwoSum class. It should suppor ...

  3. [Algorithm] Heap data structure and heap sort algorithm

    Source, git Heap is a data structure that can fundamentally change the performance of fairly common ...

  4. iOS编码规范

      The official raywenderlich.com Objective-C style guide.   This style guide outlines the coding con ...

  5. URL Parsing

    [URL Parsing] urllib.parse.urlparse(urlstring, scheme='', allow_fragments=True) Parse a URL into six ...

  6. A Complete Tutorial on Tree Based Modeling from Scratch (in R & Python)

    A Complete Tutorial on Tree Based Modeling from Scratch (in R & Python) MACHINE LEARNING PYTHON  ...

  7. 官方的objective - c风格指南。

    The official raywenderlich.com Objective-C style guide. This style guide outlines the coding convent ...

  8. What a version number means

    http://stackoverflow.com/questions/3768261/best-practices-guidance-for-maintaining-assembly-version- ...

  9. Bluetooth

    Android provides a default Bluetooth stack, BlueDroid, that is divided into two layers: The Bluetoot ...

随机推荐

  1. 经典算法题每日演练——第十七题 Dijkstra算法

    原文:经典算法题每日演练--第十七题 Dijkstra算法 或许在生活中,经常会碰到针对某一个问题,在众多的限制条件下,如何去寻找一个最优解?可能大家想到了很多诸如“线性规划”,“动态规划” 这些经典 ...

  2. 仅当使用了列的列表,并且 IDENTITY_INSERT 为 ON 时,才能在表中为标识列指定显式值问题

    今天在处理数据库过程中碰到这样的问题在插入一条数据到表中 系统报这样的错误 仅当使用了列的列表,并且 IDENTITY_INSERT 为 ON 时,才能在表中为标识列指定显式值问题 表有一列是自增长的 ...

  3. C# 中的常用正则表达式总结

    这是我发了不少时间整理的C# 的正则表达式 ,新手朋友注意一定要手册一下哦,这样可以节省很多写代码的时间,中国自学编程网为新手朋友整理发布. 只能输入数字:"^[0-9]*$". ...

  4. 剑指XX(游戏10) - 走正步工厂一个安静的农场游戏的代码

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2lsYW5ncXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...

  5. python tcp socket 多线程

    不多说,直接上代码 client.py #!/usr/bin/python import socket,sys,string host="localhost" port=8000 ...

  6. poj 3273 Monthly Expense (二分)

    //最大值最小 //天数的a[i]值是固定的 不能改变顺序 # include <algorithm> # include <string.h> # include <s ...

  7. 对JSON数组对象排序-有键相同的元素,分组数量不一致,可采用如下的JS进行循环表格输出

    var now=eval(data.data); // now.sort(sortBy('bigIdOrder', true, parseInt)); var tab=""; va ...

  8. Android KitCat 4.4.2 ADB 官方所支持的所有Services格式翻译

    在之前的文章中有转帖网上同行制作的ADB协议表格<<adb概览及协议参考>>,但不够详尽,所以这里自己另外基于Android 4.4.2的技术文档重新做一次翻译. HOST S ...

  9. Fizzler

    Fizzler 抓取网站数据不再是难事了,Fizzler(So Easy)全能搞定 首先从标题说起,为啥说抓取网站数据不再难(其实抓取网站数据有一定难度),SO EASY!!!使用Fizzler全搞定 ...

  10. The operator == is undefined for the argument type(s) int, null

    package cn.edu.shu.web.test; public class TestInteger { public static void main(String[] args) { /** ...