Search code examples
c#quartz

Get all jobs in Quartz.NET 3.0


I have jobs that are running correctly, but I need to list these from another application. I'm using Quartz version 3.0.7

I have used the following code:

        var collJobGroups = await pScheduler.GetJobGroupNames();

but it does not return anything. this one either:

        StdSchedulerFactory factory = new StdSchedulerFactory(System.Configuration.ConfigurationManager.AppSettings);
        IScheduler scheduler = await factory.GetScheduler();
        await scheduler.Start();

        IReadOnlyCollection<string> jgn = await scheduler.GetJobGroupNames(new System.Threading.CancellationToken());

Solution

  • If both applications have access to the same database then I recommend that you look at the ADO.NET Job Store instead of RAMJobStore. When you use a database as a Job Store then you can have Scheduler running in one application, and you can read job information through another application. The only problem is that you need to have jobs implemented in a separate class library because you need to have access to classes to create JobDetails.