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. 基于Jquery的多彩二维码的生成

    Demo效果图: 源代码: @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name=&quo ...

  2. [ Bubble Sort ]& block

    [ Bubble Sort ] 冒泡排序!“预处理.block.预编译”!<环境:Terminal的gcc编译器> 简述:冒泡排序就是把小的元素往前调或者把大的元素往后调.比较是相邻的两个 ...

  3. Html5 の 微信飞机大战

    (function () { var imageUrl = "images/"; //获取画布对象 var c = $("#game-box").get(0); ...

  4. 【百度地图API】如何制作泡泡放大镜?

    原文:[百度地图API]如何制作泡泡放大镜? 任务描述: 我不喜欢API提供的缩放控件耶…… 我能不能使用其他方式放大地图勒? 当然阔以啦! 现在就来教大家如何动手制作一个可爱的泡泡放大镜! 使用它, ...

  5. 如何使用Ubuntu online account API创建微博HTML5申请书

    在这篇文章中.我们将使用Ubuntu SDK提供online account API来訪问微博的API并显示所须要的内容.这篇文章的重点是展示怎样在HTML 5中使用online account AP ...

  6. AFNetworking3.0 POST请求

    // 请求管理者 AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; manager.responseSerializer ...

  7. MVC验证11-对复杂类型使用jQuery异步验证

    原文:MVC验证11-对复杂类型使用jQuery异步验证 本篇体验使用"jQuery结合Html.BeginForm()"对复杂类型属性进行异步验证.与本篇相关的"兄弟篇 ...

  8. Object-C面向对象之实现类

    Object-C面向对象之实现类 一般涉及到面向对象都会C#,Java都不可避免的涉及到类,C#中类的后缀名是.cs,Java中是.java,Object-C中一般用两个文件描述一个类,后缀名为.h为 ...

  9. C语言与sqlserver数据库

    原文:C语言与sqlserver数据库 1.使用C语言来操作SQL SERVER数据库,采用ODBC开放式数据库连接进行数据的添加,修改,删除,查询等操作. step1:启动SQLSERVER服务,例 ...

  10. W5500问题集锦(一)

    在"WIZnet杯"以太网技术竞赛中,有非常多參赛者在使用中对W5500有各种各样的疑问,对于这款WIZnet新推出的以太网芯片,使用中大家是不是也一样存在下面问题呢?来看一看: ...