none
Quartz scheduler not working on cloud service

    Question

  • I had deployed a cloud service in which i has use Quartz scheduler to run a particular task at a particular time (3:00 AM).

    But the service does not run the scheduler at that time.

    I had debugged it but not able to get the exact solution. 

    If i deploy the app to local iis and check, it runs fine with the scheduler.

    Does the cloud service recycles every 24 hrs, because Quartz scheduler will only hit if the app is running and ping after recycling.
    Recycling happens in iis every 24 hrs so we need to hit the app manually for the scheduler to work.

    so can you please assist me to get the issue why my scheduler is not working 

    (Is it because of recycling ?)

     
    Wednesday, June 24, 2015 7:47 AM

Answers

  • Hi Aakash,

    I'm afraid this is not something that we can resolve through a forum post as more information would be needed.
    It would also most likely be necessary to look at your deployment via a remote desktop session.
    We would request you to raise a Technical Support Case for further assistance with this issue.
    You could refer the following link to open a technical support case:
    http://azure.microsoft.com/en-in/support/options/

    Regards,
    Malar.

    Tuesday, June 30, 2015 3:03 AM

All replies

  • Hi Aakash,

    Could you tell us how you implement the Quartz Scheduler in your Azure Cloud Service?
    The Cloud Service you're referring to, is it a web role?
    When you say, the scheduler does not work, does it give any error messages or the scheduler runs at a different time or does not run at all?
    It might be helpful to isolate and troubleshoot the issue better if you could provide further details.

    You could refer the following link for some help:
    http://mattrandle.me/azure-worker-role-and-quartz-net/

    Also, you could consider using Azure Scheduler as well.
    You could refer the following links for details on Azure Scheduler:
    https://azure.microsoft.com/en-us/documentation/articles/scheduler-intro/
    https://azure.microsoft.com/en-us/documentation/articles/scheduler-get-started-portal/

    Regards,
    Malar.


    Wednesday, June 24, 2015 10:22 AM
  • Hello Malar,

    The Cloud service is a web role.

    this link for "azure-worker-role-and-quartz-net"

    explains for a worker role.

    I am not able to get the exact issue nor able to get any exceptions because the scheduler is not hitting.

    If the (Quartz .Net) scheduler got hit then only i will get some exception or cause, but the basic is not working (running the scheduler)

    I have initialized scheduler in global.ascx.cs file by this line

     JobScheduler.Start(); 

    and then in start :

    public class JobScheduler
        {
            public static void Start()
            {
                // construct a scheduler factory
                ISchedulerFactory schedFact = new StdSchedulerFactory();

                // get a scheduler
                IScheduler sched = schedFact.GetScheduler();
                sched.Start();

                // define the job and tie it to our HelloJob class
                IJobDetail job = JobBuilder.Create<FetchFtpFilesAndSendToStorageJob>()
                    .WithIdentity("FetchFtpFilesAndSendToStorageJob", "SyncData")
                    .Build();

                // Trigger the job to run now, and then every day at 3:00 AM 
                 ITrigger trigger = TriggerBuilder.Create()
                     .WithIdentity("FetchFtpFilesAndSendToStorageJobTrigger", "SyncData")
                     .WithCronSchedule("0 0 3 1/1 * ? *").ForJob(job)
                     .Build();
                
                sched.ScheduleJob(job, trigger);
            }
        }


    but the trigger is not getting fired at the time specified.

    Here if i add a webRole file like below :

     public class WebRole : RoleEntryPoint
        {
            public override bool OnStart()
            {
                JobScheduler.Start();
                return base.OnStart();
            }
        }


    Will that work?

    Thanks. :) 




    • Edited by Aakash P Wednesday, June 24, 2015 11:09 AM
    Wednesday, June 24, 2015 11:07 AM
  • Hi Aakash,

    I'm afraid this is not something that we can resolve through a forum post as more information would be needed.
    It would also most likely be necessary to look at your deployment via a remote desktop session.
    We would request you to raise a Technical Support Case for further assistance with this issue.
    You could refer the following link to open a technical support case:
    http://azure.microsoft.com/en-in/support/options/

    Regards,
    Malar.

    Tuesday, June 30, 2015 3:03 AM
  • I got this working when i deployed my app in production slot.

    Thanks for the help


    Aakash P


    • Edited by Aakash P Friday, August 21, 2015 9:22 AM
    Friday, August 21, 2015 9:22 AM