Quartz.NET is a full-featured, open source enterprise job scheduling system written in .NET platform that can be used from smallest apps to large scale enterprise systems. I want to schedule the execution of a task but only when something happens. Let’s call that something a trigger, so… if the trigger is met => execute the task.
Sounds simple, why not use windows task scheduler for this?
What is the problem that we trying to address?
Well, windows task scheduler is great for tasks where the trigger can be easily defined. With windows task scheduler will you be able to schedule a task to run on every working day according to the UK calendar (exclude all weekends & bank holidays) without either writing the logic for day check in the task or a wrapper script calling into the task.
The task should just contain the execution logic and should not have anything to do with the schedule for execution; Quartz.net allows you to achieve this and lots more. A quartz.net trigger gives you the flexibility for task invocation based on the following triggers,
- at a certain time of day (to the millisecond)
- on certain days of the week
- on certain days of the month
- on certain days of the year
- not on certain days listed within a registered Calendar (such as business holidays)
- repeated a specific number of times
- repeated until a specific time/date
- repeated indefinitely
- repeated with a delay interval
Did 8 – repeat indefinitely just ring a bell? I’ll be covering that in the future post.
Using Quartz.net as a windows service
You can have Quartz.net run as a standalone instance within its own .NET virtual machine instance via .NET Remoting. Let’s take a look at typical application architecture. In the figure below, I have the application tier set up on Machine 1, database set up on Machine 2 and Quartz.net set up on Machine 3 which is normally the architecture for most (if not all) enterprise applications.
Figure 1 - Typical Application architecture while using Quartz.net as a windows service
What other options do I have if I don’t want to use Quartz.net?
Quartz.net is just one of the many job scheduling services. Have a look at this comprehensive list of free and paid enterprise job scheduling software along with their feature comparison. http://en.wikipedia.org/wiki/List_of_job_scheduler_software
This was first in the series of posts on enterprise scheduling using Quartz.net, in the next post I’ll be covering how to Install Quartz.net as a windows service. All Quartz.Net specific blog posts can listed here. Thank you for taking the time out and reading this blog post.
- Tag Admin extension is now available for Visual Studio 2017
- Options for displaying modal dialogs in Visual Studio extensions
- MSBuild Dependency Visualizer tool
- 'Value does not fall within the expected range' error while adding toolbar to toolwindow
- AppVeyor extension for Visual Studio 2013/2015
About Tarun Arora
- How to restore Azure SQL DW GeoBackup across Azure subscriptions..
- GitHub Issues - As a deployment gate in VSTS Release Management
- Automate DevSecOps with CI CD using VSTS...
- Integrating VSTS Release Management with ServiceNow using Deployment Gate for Change Management
- Integrating VSTS for DevOps with privately hosted Azure App Service
- Team Services - Use one build definition to build all branches & release selectively
- VSTS Status Monitor - A Google Chrome extension to monitor VSTS Status
- How to transform Web.Config file 'Properly' with VSTS!