General Structure of Quartz.NET and How To Implement It
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:
General Structure of Quartz.NET and How To Implement It的更多相关文章
- 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 ...
- 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 ...
- [Algorithm] Heap data structure and heap sort algorithm
Source, git Heap is a data structure that can fundamentally change the performance of fairly common ...
- iOS编码规范
The official raywenderlich.com Objective-C style guide. This style guide outlines the coding con ...
- URL Parsing
[URL Parsing] urllib.parse.urlparse(urlstring, scheme='', allow_fragments=True) Parse a URL into six ...
- 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 ...
- 官方的objective - c风格指南。
The official raywenderlich.com Objective-C style guide. This style guide outlines the coding convent ...
- What a version number means
http://stackoverflow.com/questions/3768261/best-practices-guidance-for-maintaining-assembly-version- ...
- Bluetooth
Android provides a default Bluetooth stack, BlueDroid, that is divided into two layers: The Bluetoot ...
随机推荐
- 做ACM该伤不起啊!!
開始搞ACM啊!! ! .! ! ! ..! 从此踏上了尼玛不归路啊! !! !!! !!.!!! 谁特么跟劳资讲算法是程序设计的核心啊..! ! ! . 尼玛除了面试题就没见过用算法的地方啊!!! ...
- [CLR via C#]6. 类型和成员基础
原文:[CLR via C#]6. 类型和成员基础 6.1 类型的各种成员 在一个类型中,可以定义0个或多个以下种类的成员: 1)常量 常量就是指出数据值恒定不变的符号.这些符号通常用于使代码更 ...
- .net mvc mssql easyui treegrid
效果图 数据图 可以看到 这里是根据 MenuNo 来 分级别的,支持 无限极,第一级是 01 ,第二级就是 01XX ,第三级 就是 01XXOO.类似 id.pid ,Ztree 里面 也是这 ...
- 表单验证 jquery-validation
表单验证首选:jquery-validation 参见 http://jqueryvalidation.org/ 下载之后 在 demo 的index 页面有各种API 详细的案例. 还可以参考 h ...
- POJ 1035 代码+具体的目光
Spell checker Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 19319 Accepted: 7060 Descri ...
- HDU 4228 Flooring Tiles 反素数
推出了结论,万万没想到最后用搜索.. 还想dp来着.. #include <cstdio> #include <cstring> #include <iostream&g ...
- MySQL的备份与还原
原文:MySQL的备份与还原 MySQL备份和还原,都是利用mysqldump.mysql和source命令来完成的. 1.Win32下MySQL的备份与还原 1.1 备份 开始菜单 | 运行 | c ...
- (12) MVC5 EF6 Bootstrap3
MVC5 + EF6 + Bootstrap3 (12) 新建数据 系列教程:MVC5 + EF6 + Bootstrap3 上一节:MVC5 + EF6 + Bootstrap3 (11) 排序.搜 ...
- C#遍历文件名
遍历文件名程序 //////////////////第一种方法///////////// static ArrayList GetAllFiles(string path) { ArrayList r ...
- 2.2 LINQ中使用from子句指定数据源
数据源是LINQ查询中必不可少的元素,数据源是实现泛型接口IEnumerable<T>或IQueryable<T>的类对象. 可以将IEnumerable<T>简单 ...