Open Source task management Platform TaskManager Introduction

Source: Internet
Author: User

I was ready to write the Quartz series earlier, and now I can finally achieve it. From the beginning of this article will take you to achieve a task management platform. Do you ever need an application to perform a task at work? This task is performed every day or at 11:30 on a weekly Tuesday night, perhaps only on the last day of the month. An automatic execution without intervention if a critical error occurs during execution, will the application be aware of its execution failure and attempt to re-execute it? You and your team are using. NET programming? If any of these questions you answer yes, then you should use the Quartz.net scheduler.

Read Catalogue

    • Quart.net Introduction
    • Cron-expression
    • Open source TaskManager Implementation principle
    • Introduction to use
    • Summarize
Back to top quartz.net introduction

Quartz.net is an open-source job scheduling framework, which is a. Net migration of the Opensymphony Quartz API, written in C # that can be used in WinForm and ASP. It provides a great deal of flexibility without sacrificing simplicity. You can use it to create simple or complex schedules for executing a job. It has many features, such as database support, clustering, plugins, support for cron-like expressions, and so on. : quart.net

To give a practical example: now need to implement a courier Progress query application, we certainly do not have a database of various courier manufacturers, can only use the API interface provided by vendors to obtain data. Fortunately, there are a lot of ready-made interfaces that are integrated with each vendor, based on these basics. Now the customer has made a demand, in the delivery of the progress of the change, send me an email or sms reminders. I think a lot of online shopping friends have this demand, bought a thing, from time to time to check the progress, look forward to early. Then this reminder is very urgent, I am also based on this requirement to do TaskManager open source project.

Back to top cron expression

The cron expression is used to specify how often the task executes, and I have already written an article on the quartz cron expression online generator that you can use directly.

Back to top open source TaskManager introduction and implementation principle

TaskManager is an open source task management system based on Quartz.net, which is hosted using the window service. At present, the system integrates three common tasks, proxy IP crawler, courier progress, message notification.

Agent IP crawler : Every hour from the site to crawl the latest proxy IP information, crawling down the data exist P_ipproxy table, with these proxy IP, can be used to do voting machine, brush interface and other applications. I believe you have met a classmate or colleague sent you a link to help you to vote for XX, such as the problem, but many votes are limited to one IP only vote, then with a lot of proxy IP you can achieve a person voted N. An example of getting data using the proxy IP request interface will be presented in the next article.

Courier Progress: It is a great boon for friends who are keen on online shopping, and of course for me. Often online shopping friends the biggest trouble may be my express to where, from time to time to open the client to check the progress of the courier, if there is a change in the delivery process can send text messages or email reminders of the function is good, I will no longer have to hurry to find out where the courier. Look at the email alert effect, there is no very excited, very want to use this open source TaskManager platform!

Message Notification: message notification related table P_message (to send Message table), P_messagehistory (sent or sent failure message table)

At present, the Courier task has information changes will insert a message, the message notifies the task 3 minutes to poll the P_message table, for each message will be sent up to three times (the first two failed), send the completion of the P_message data inserted into the P_messagehistory

Project Structure: The project is a quartz.net-based Windows service that currently contains six projects

System Principle Analysis:

Development mode:

Add a new task step as follows

1. Under the Mysoft.task Project Taskset folder, add a task class that inherits the Ijob interface, and you can refer to the existing Ipproxyjob

2. Modify the Taskconfig.xml configuration file

What is the most important part of running frequency cronexpressionstring need to write? Here also for everyone to consider, you can use the online cron generator to generate, address http://jason.hahuachou.com/cron/index.htm, you can also use the source code provided in the Cron own deployment site use.

Back to top use introduction

Introduced the function and the implementation principle, now describes how to use the TaskManager. Because using Windows services as a bearer, we only need to know how to install Windows services, we can use the platform. Considering that many people do not know how to load the Windows service, so provide me with a gadget previously written by Windows service security loading and unloading. The source code is also placed in the TaskManager.

1. Right-click the administrator to run the Windows Mount Loader tool

2. Select taskmanger.exe-"Install-" run

After a successful run, you can find the "Timed Task management Service" in the System administration-"service"

After a successful run, the logs folder is generated, recording the execution log

Of course you need to configure the system when you use it, so let's talk about the configuration process. System configuration File Path Config\config.xml

1. Database connection Information

Users can take the task system "SQL Merge Script _20150911.sql" to create related tables and initial data from SVN download code mydocument project

Modify the value of the node SQLConnect node for your own database connection

2. Insert the Express single simulation data

The current use of courier tasks need to manually insert the courier number Information

INSERT  into dbo.p_expressinfo (expressno,expresscompanycode,receiver) SELECT ' 880350384879600241 '  as Expressno,'yuantong' as Expresscompanycode,'[email Protected]' as Receiver

where [email protected] to receive progress information change email address, as long as there is progress changes, the system will automatically send e-mail, Remember to change to their own e-mail address

Expressno: For Courier number

Expresscompanycode: Express Company code This value can be queried from the P_expresscompany table

For more instructions, refer to the instructions for use under the mydocument Project . docx Documentation

Back to top of the summary

This article to introduce the end of the content, the following to write my expectations! Hope to have a favorite friend to improve TaskManager (fully open source), so that it can improve the convenience of life tools, add a lot of new tasks. For example: The next day to rain or snow, send an e-mail reminder, take an umbrella .... Okay, it's time to release the source code. Please look forward to the next article!

TASKMANAGERSVN Address: Http://code.taobao.org/svn/TaskManagerPub/Branch Use the SVN checkout command to download.

Experience Tool: TaskManager unzip the file as follows, modify the CONFIG. db connection and use Wswinform to install.

If you think reading this blog gives you something to gain, just click on the " recommend " button in the lower right corner.
If you want to find my new blog more easily, click on " Follow me " in the green channel.
Because, my writing enthusiasm also inseparable from your affirmation support.

Thank you for your reading, if you are interested in the content of my blog, please continue to follow my following blog, I am the flame tail Diego.

Open Source task management Platform TaskManager Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.