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. android 应用程序框架

    携带Android软件开发时间,由开发商开发Android应用程序是通过应用程序框架和Android底层交互,因此,发展以达到最大的部分是应用程序框架. 应用集成框架 那里4一个重要组成部分,以下. ...

  2. 在VirtualBox安装OS X 10.10

    下面将指导介绍了如何引入自由和强大VirtualBox安装在虚拟机上OS X Yosemite 10.10 法律免责声明:本指南旨在说明如何在定期购买的苹果电脑上创建一个虚拟机执行真正的Mac OS ...

  3. SHDocVw, AxSHDocVw的引用

    原文:SHDocVw, AxSHDocVw的引用 SHDocVw的引用SHDocVw一定要在下面这个路径找: 类似 C:\Program Files\Microsoft Visual Studio 9 ...

  4. UIAppDelegate介绍

    #import "GLAppDelegate.h" @implementation GLAppDelegate // 当应用程序启动完毕的时候就会调用(系统自动调用) - (BOO ...

  5. 【Unity 3D】学习笔记四十一:关节

    关节 关节组件能够加入至多个游戏对象中,而加入关节的游戏对象将通过关节连接在一起而且感觉连带的物理效果.须要注意的是:关节必须依赖于刚体组件. 关节介绍 关节一共分为5大类:链条关节,固定关节,弹簧关 ...

  6. SVN:One or more files are in a conflicted state

    解决代码冲突 如果commit时出现"You have to update your work copy first."红色警告,说明版本库中的此文件已经被其他人修改了. 请先点& ...

  7. sql注入工具sqlmap使用参数说明

    Options(选项):--version 显示程序的版本号并退出-h, --help 显示此帮助消息并退出-v VERBOSE 详细级别:0-6(默认为1)Target(目标):以下至少需要设置其中 ...

  8. 关于session_start()这个问题

    关于session_start()这个问题,其实网上很多解决的方法,论坛也好多人回答这类的问题, 现在的状况是依然有警告提示Warning: session_start() [function.ses ...

  9. Android正在使用Handler实现消息分发机制(两)

    在开始这篇文章之前,.首先,我们在总结前两篇文章Handler, Looper和MessageQueue像一些关键点: 0)在创建线程Handler之前,你必须调用Looper.prepare(), ...

  10. datagridcolumn单元格怎么显示查询到的某个表的字段值(字段值可能为多个)

    例如,在之前做的项目中,查询mhz_xckcr表,select出某个业务的现场勘察人信息,select出的现场勘察人姓名(可能有多个)要在前台datagrid的一个datagridcolmn单元格显示 ...