Reputation: 117
I am using Azure WebJobs to clean records from my database 48 hours after I have added them. The WebJob is always listening onto a message queue (also on Azure) which will contain a message that specifies which record to delete.
I add record to the DB though my C# MVC application. I wish to use the Azure scheduler to push a message onto the Queue 48 hours after I have added the record. I can't seem to find a way how to schedule these tasks automatically through my MVC. Is this possible ? I have found ways to call an already configured scheduled job , but I need to create these jobs when I add the records, so that record specific information is passed to the scheduler body.
Upvotes: 1
Views: 1824
Reputation: 476
You can create these jobs using Azure Management Libraries .NET as mentioned here http://geekswithblogs.net/shaunxu/archive/2013/12/16/use-windows-azure-scheduler-through-.net-sdk.aspx
Upvotes: 1
Reputation: 4936
Other option would be that instead of doing an continuously WebJob listening to a queue, it could be a WebJob in scheduled mode, checking for items for example in Azure Table Storage if there some jobs to do and if those jobs are 48 hours old.
Upvotes: 1
Reputation: 136196
I add record to the DB though my C# MVC application. I wish to use the Azure scheduler to push a message onto the Queue 48 hours after I have added the record.
One way to achieve this is to immediately push the message in the queue but keep it invisible for 48 hours through a property called initialVisibilityDelay
when adding message to a queue. Will that be an acceptable solution?
Upvotes: 1