连续Web作业带定时触发和斑点触发 [英] Continuous Web Job with timer trigger and Blob trigger

查看:294
本文介绍了连续Web作业带定时触发和斑点触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用蔚蓝的工作SDK及其扩展同一Web作业控制台应用程序下面的功能。定时触发查询的API终点为一个文件,不就可以了一些额外的工作,然后将文件保存到名为blahinput团块。现在第二个方法ProcessBlobMessage应该是确定新的blob文件中的blahinput,并用它做什么。

I have the following functions in the same web job console app that uses the azure jobs sdk and its extensions. The timed trigger queries an API end point for a file, does some additional work on it and then saves the file to the blob named blahinput. Now the second method "ProcessBlobMessage" is supposed to identify the new blob file in the blahinput and do something with it.

public static void  ProcessBlobMessage([BlobTrigger("blahinput/{name}")] TextReader input,
        string name, [Blob("foooutput/{name}")] out string output)
    {//do something        }

    public static void QueryAnAPIEndPointToGetFile([TimerTrigger("* */1 * * * *")] TimerInfo timerInfo) { // download a file and save it to blob named blah input}

这里的问题是:
当我部署上面说的Web作业连续,只有定时器触发的事件似乎被触发而应该功能,以确定新的文件永远不会被触发。它是不可能有两个这样的触发器在同一个网站的工作吗?

The problem here is : When I deploy the above said web job as continuous, only the timer triggered events seems to get triggered while the function that is supposed to identify the new file never gets triggered. Is it not possible to have two such triggers in the same web job?

推荐答案

从这篇文章:<一href=\"https://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-webjobs-sdk-storage-blobs-how-to/\"相对=nofollow>如何使用Azure的Blob存储与WebJobs SDK

该WebJobs SDK扫描日志文件来监视新的或更改的斑点。这个过程不是实时的;一个函数可能不会被触发,直到几分钟或更长时间的斑点在创建后。此外,存储日志,正在尽最大努力基础上创建的;也不能保证所有的事件将被捕获。在某些情况下,日志可能被错过。如果BLOB触发器的速度和可靠性限制,不适合你的应用程序可以接受的,推荐的方法是在创建BLOB创建队列消息,使用 QueueTrigger 属性而不是在该处理BLOB的功能 BlobTrigger 属性。

The WebJobs SDK scans log files to watch for new or changed blobs. This process is not real-time; a function might not get triggered until several minutes or longer after the blob is created. In addition, storage logs are created on a "best efforts" basis; there is no guarantee that all events will be captured. Under some conditions, logs might be missed. If the speed and reliability limitations of blob triggers are not acceptable for your application, the recommended method is to create a queue message when you create the blob, and use the QueueTrigger attribute instead of the BlobTrigger attribute on the function that processes the blob.

这篇关于连续Web作业带定时触发和斑点触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆