Saturday, 15 September 2012

c# - Calling method using Azure scheduled webjob -


I want to call my method using Azure webjobs as shown. But I want to run it every 5 minutes from 13 March to 20 March for local test purposes. I have followed the instructions accordingly. I have created test storage accounts and then added connection strings added to app.config and web.config files.

  class program {static zero major () {var host = new JobHost (); // The following code will pass in a function called manual trigger and // data (in this case value) hosts the function. Call (typef (work) .GetMethod ("GetStockAndStoreToDB"), new {value = 20}); //host.RunAndBlock (); }}  

Here I want to call GetStockAndStoreToDB my method. Public Static Zero GetStockAndStoreToDB (TextWriter log, int value, [quote ("stockrequestqueue")] String message out {implemented} {log.WriteLine (with "function value = {0}" Goes, value); Message = value Toasting (); Bool dbUpdate = false; String [] iconAre = {"Yahoo", "Google", "Microsoft"}; Forex currency (symbol string in the ring) {// Receive stock on stock instead of priority Stock = Helper.Gate Delistoc (symbol); Message = symbol Toasting (); // Store in DB dbUpdate = Helper. SATHistoricStockToDB (returnstock); } Log.WriteLine ("The following message will be written on line = {0}", message); }

and the code for the specified task (run for every 5 minutes for the test purpose, once only once the work has started, I will change it once daily to run):

  {"$ schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json", "WebJobname": "StockWebjob", "Start Time": "2015-03-13T16: 00: 00-05: 00", "Endime": "2015-03-20T16: 00: 00-05: 00", "Jobrequency Frequency": "Minute", "Day" "Interval": 5, 1/1 "Run Mode": "Scheduled"}  

In my Controller Not:

  private Claudkyuui Stokruektekveyu; Public Stock Controller () {Initial Storage (); } Private void InitializeStorage () {// Open Storage Account by using credentials from the .cscfg file. Var Storage Intectal = Cloud StorageAccount. Purse (configuration manager.connection strings ["azurewebjobstorage"] .toasting ()); // CloudStorageAccount storageAccount = CloudStorageAccount.Parse (CloudConfigurationManager.GetSetting ("AzureWebJobsStorage")); // Get reference objects to work with queue, and // Set a default retry policy appropriate for a web user interface. CloudQueueClient Quill Client = Storage ACCOUNT.CreateCloudQueueClient (); //queueClient.DefaultRequestOptions.RetryPolicy = new linear line (timespace.formsconds (3), 3); // Get a reference for the queue StockRequestQueue = queueClient.GetQueueReference ("StockQuenchu"); // Create queue if it is not already present in stockRequestQueue.CreateIfNotExists (); // Create a message and add it to the queue CloudQueueMessage queue message = New cloudquery message ("Receive Stock"); StockRequestQueue.AddMessage (queueMessage); }  

Please advise me why I am doing wrong, because the console once makes and stops, it does not last up to every 5 minutes. If I use Hosts, Ron Andblock (); So the console is open but it does not run anything.


No comments:

Post a Comment