Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8041999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:25:11+00:00 2026-06-05T04:25:11+00:00

Ok, little bit of background here. I have a large scale web application (MVC3)

  • 0

Ok, little bit of background here. I have a large scale web application (MVC3) which does all kinds of unimportant stuff. I need this web application to have the ability to schedule ad-hoc Quartz.NET jobs in an Oracle database. Then, I want the jobs to be executed later on via a windows service. Ideally, I’d like to schedule them to run in even intervals, but with the option to add jobs via the web app.

Basically, the desired architecture is some variation of this:

Web app <–> Quartz.NET <–> Database <–> Quartz.NET <–> Windows Service

What I have coded up so far:

  • A windows service which (for now) schedules AND runs the Jobs. This obviously isn’t going to be the case in the long run, but I’m wondering if I can keep just this and modify it to have it basically represent both “Quartz.NET’s” in the diagram above.
  • The web app (details I guess aren’t very important here)
  • The jobs (which are actually just another windows service)

And a couple important notes:

  • It HAS to be run from a windows service, and it HAS to be scheduled through the web app (to reduce load on IIS)
  • The architecture above can be rearranged a little bit, assuming the above bullet still applies.

Now, a few questions:

  1. Is this even possible?
  2. Assuming (1) passes, what do you guys think is the best architecture for this? See first bullet on what I’ve coded up.
  3. Can somebody maybe give me a few Quartz methods that will help me out with querying the DB for jobs to execute once they’re already scheduled?

There will be a bounty on this question in as soon as it is eligible. If the question is answered in a satisfactory way before then, I will still award the bounty to the poster of the answer. So, in any case, if you give a good answer here, you’ll get a bounty.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:25:13+00:00Added an answer on June 5, 2026 at 4:25 am

    I’ll try answering your questions in the order you have them.

    1. Yes, it’s possible to do this. It’s actually a common way of working with Quartz.Net. In fact, you can also write an ASP.Net MVC application that manages Quartz.Net schedulers.

    2. Architecture. Ideally and at a high level, your MVC application will use the Quartz.Net API to talk to a Quartz.Net server that is installed as a windows service somewhere. Quartz.Net uses remoting to communicate remotely, so any limitations of using remoting apply (like it’s not supported in Silverlight, etc). Quartz.Net provides a way to install it as a windows service out of the box, so there really isn’t much work to be done here, other than configuring the service itself to use (in your case) an AdoJobStore, and also enabling remoting. There is some care to be taken around how to install the service properly, so if you haven’t done that yet, take a look at this post.

    Internally, in your MVC application you’ll want to get a reference to the scheduler and store it as a singleton. Then in your code you’ll schedule jobs and get information about the scheduler through this unique instance. You could use something like this:

    public class QuartzScheduler
    {
        public QuartzScheduler(string server, int port, string scheduler)
        {
            Address = string.Format("tcp://{0}:{1}/{2}", server, port, scheduler);
            _schedulerFactory = new StdSchedulerFactory(getProperties(Address));
    
            try
            {
                _scheduler = _schedulerFactory.GetScheduler();
            }
            catch (SchedulerException)
            {
                MessageBox.Show("Unable to connect to the specified server", "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
        public string Address { get; private set; }
        private NameValueCollection getProperties(string address)
        {
            NameValueCollection properties = new NameValueCollection();
            properties["quartz.scheduler.instanceName"] = "RemoteClient";
            properties["quartz.scheduler.proxy"] = "true";
            properties["quartz.threadPool.threadCount"] = "0";
            properties["quartz.scheduler.proxy.address"] = address;
            return properties;
        }
        public IScheduler GetScheduler()
        {
            return _scheduler;
        }
    }
    

    This code sets up your Quart.Net client. Then to access the remote scheduler, just call

    GetScheduler()
    
    1. Querying
      Here is some sample code to get all the jobs from the scheduler:

      public DataTable GetJobs()
      {
          DataTable table = new DataTable();
          table.Columns.Add("GroupName");
          table.Columns.Add("JobName");
          table.Columns.Add("JobDescription");
          table.Columns.Add("TriggerName");
          table.Columns.Add("TriggerGroupName");
          table.Columns.Add("TriggerType");
          table.Columns.Add("TriggerState");
          table.Columns.Add("NextFireTime");
          table.Columns.Add("PreviousFireTime");
          var jobGroups = GetScheduler().GetJobGroupNames();
          foreach (string group in jobGroups)
          {
              var groupMatcher = GroupMatcher<JobKey>.GroupContains(group);
              var jobKeys = GetScheduler().GetJobKeys(groupMatcher);
              foreach (var jobKey in jobKeys)
              {
                  var detail = GetScheduler().GetJobDetail(jobKey);
                  var triggers = GetScheduler().GetTriggersOfJob(jobKey);
                  foreach (ITrigger trigger in triggers)
                  {
                      DataRow row = table.NewRow();
                      row["GroupName"] = group;
                      row["JobName"] = jobKey.Name;
                      row["JobDescription"] = detail.Description;
                      row["TriggerName"] = trigger.Key.Name;
                      row["TriggerGroupName"] = trigger.Key.Group;
                      row["TriggerType"] = trigger.GetType().Name;
                      row["TriggerState"] = GetScheduler().GetTriggerState(trigger.Key);
                      DateTimeOffset? nextFireTime = trigger.GetNextFireTimeUtc();
                      if (nextFireTime.HasValue)
                      {
                          row["NextFireTime"] = TimeZone.CurrentTimeZone.ToLocalTime(nextFireTime.Value.DateTime);
                      }
      
                      DateTimeOffset? previousFireTime = trigger.GetPreviousFireTimeUtc();
                      if (previousFireTime.HasValue)
                      {
                          row["PreviousFireTime"] = TimeZone.CurrentTimeZone.ToLocalTime(previousFireTime.Value.DateTime);
                      }
      
                      table.Rows.Add(row);
                  }
              }
          }
          return table;
      }
      

    You can view this code on Github

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll start here with a little bit of background. We have an ASP.Net MVC
Little bit of background, I'm more experienced with Java, and have some C/C++ experience.
In my application I need to have periodically run background tasks (which I can
Ok so a little bit of a strange one, I have 2 ul's with
I'm a little bit unfriendly with Visitor pattern, but I have a task that
I'm have a little bit of trouble storing and accessing a multidimensional array from
A little background on the application that I am gonna talk about in the
This is a bit esoteric, but there have to be a few people here
I come from a C# background and I have a bit of a tough
Problem: Multiple asynchronously invoked Effect.Appear() calls do not all resolve properly. Background: I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.