Running Azure WebJob without queue

蓝咒 提交于 2019-12-06 03:46:08

问题


Is there a way to schedule a job without having listen to the queue? I mean I would like to run it every hour or so and do something, regardless of the queue. Does that even make sense? One solution I can think of is to queue a message to itself each time the job is done, but that doesn't look like a clean solution to me.


回答1:


Create a scheduled job with a 1 hour frequency and use Host.Call to invoke the function. See the ManualTrigger function in this code sample




回答2:


Of course, no need to listen to a queue. Check the WebJobs documentation on how to schedule a job: http://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateScheduled




回答3:


The easiest way to schedule a job is to use a TimerTrigger on the WebJob method you'd like to execute on a schedule.



来源:https://stackoverflow.com/questions/24438115/running-azure-webjob-without-queue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!