Reputation: 1292
I want to implement a job scheduler in my windows azure application.
My aim is to execute a specific application at each day at a particular time. For the that implementation I have some choice
1-Using Quartz.net
2-Windows scheduler
If there is any built in method available in C#.net for implement that. I hard about Windows Azure HPC Scheduler. Is it scheduler ?.
Upvotes: 4
Views: 4187
Reputation: 273
In the case you use the ScheduledEnqueueTimeUtc property to delay the message enqueuing, I was wondering where the message is stocked before being sent to the queue? Because if you have 2 instances of your Web/Worker Role, what will happen?
Two scenario : 1. - InstanceA stock the message in its cache, waiting to deliver it to the queue - InstanceA fail for any reason. - The message is lost forever.
In both case, it seems that the solution is not reliable..
Upvotes: 0
Reputation: 24895
The Job Scheduler functionality was recently added to Windows Azure allowing you to easily schedule jobs on specific intervals:
Here is a blog post explain how you can use these jobs to communicate with Web Sites, Web Roles and even Worker Roles: http://fabriccontroller.net/blog/posts/job-scheduling-in-windows-azure/
Upvotes: 6
Reputation: 24895
When you're doing scheduling in the Windows Azure there's something you need to keep in mind. You can have multiple instances of your Web/Worker Roles, meaning you have to take into account that your scheduled task could run multiple times, and that might not be something you want.
You might consider creating a scheduling system using Service Bus Queues. The BrokeredMessage class has an interesting property called ScheduledEnqueueTimeUtc, allowing you to schedule when a message should be enqueued (made available). This would allow fill the queue with messages that show up each hour for example.
And if you decide to build such an implementation using Service Bus Queues you can decide to process messages at-most once (ReceiveAndDelete) or at least once (PeekLock).
Upvotes: 4
Reputation: 71030
While scheduling has been answered numerous times before (which is why I suggested this is a duplicate), I realized you asked a few specific things that haven't been addressed:
Please look at the other answer I referred to, as I provide an answer there that gives you details on creating a scheduler.
Upvotes: 2