Project Description
NQueue provides an enterprise level work scheduling and execution framework and toolset that contains no single point of failure. Using a farm of servers and a clustered SQL server backend, multiple NQueue windows services compete to evaluate configured schedules and execute work

NQueue is a distributed system written in C# composed of the following high level components;
• Admin tool – A windows form application that enables add and delete operations against the various artefacts in a NQueue installation (jobs, schedules, host instances). This would typically be used to view or change the system configuration although it can also be used to immediately enqueue items of work for execution (during testing for example)
• NQueue Monitor website – A website allowing operations and support staff to view the progress of configured jobs. They may also pause or disable job instances from this tool.
• SQL Database – all state for the system is stored in a central (clustered) SQL database.
• Windows services – NQueue processing services running on any number of configured servers competing to evaluate job schedules and execute job code.
• Client API – A .net class library that users can consume/inherit from to allow their job code to interact with the framework.
• NQueueCmd – command line enqueuing of work to execute immediately.

Full documentation here: NQueue Overview.docx

Client code running in the framework is easily authored, e.g.

using System;
using NQueue.Client;

namespace TestJob
{
    public class HelloWorldJob : Job
    {
        protected override ExecutionResults 
            ExecuteJobImplementation(ExecutionContext context)
        {
            if (!(ParametersObject is TestJobParams))
            {
                throw new InvalidOperationException(
                    "Parameters object was not of type TestJobParams");
            }
            TestJobParams jobParams = (TestJobParams)ParametersObject;
            System.Diagnostics.EventLog.WriteEntry("NQueue", 
                "Hello " + jobParams.Name);
            return ExecutionResults.Success;
        }

        protected override string JobTypeName
        {
            get { return "Test Job"; }
        }

        public override Type ParametersType
        {
            get { return typeof(TestJobParams); }
        }
    }

    public class TestJobParams
    {
        private string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

    }
}

The following diagram shows the high level architecture

NQueuearchitecture.gif


Website of original author here: http://bencops.blogspot.com/

Other contributors
Elton Stoneman http://geekswithblogs.net/EltonStoneman/Default.aspx
Suneet Nangia http://www.suneet.net/

Last edited May 17, 2010 at 4:47 PM by bencops, version 2