0

I have an Azure WebJob (.NET Core - SDK 3) that is braking when an execution of queue triggered function fails. I would like this WebJob to behave like others WebJobs (SDK 2 - .NET Framework) I have running on Windows WebApps.

When execution of queue triggered functions fail on WebJobs SDK 2 (Windows WebApp) the message is sent back to queue with DequeueCount incremented and after X times (default is 5) message is sent to poison queue. And the WebJob always keeps running.

Is it possible to have same behavior with WebJobs SDK 3? This is an example of described bahavior (webjobs.ricardogaefke.com). In this case I needed to use a try/catch and manually send the message to poison queue and it is a waste of the power of webjobs (retry is lost this way).

Thank you very much.

4

1 回答 1

0

我使用FunctionExceptionFilterAttribute. 函数的过滤器类似于 ASP.NET MVC 过滤器,在我的情况下,我可以在我的 WebJob 的函数中处理错误,并Task在出错时返回已完成,因此消息使用 DequeueCount++ 发送回队列(直到出队的限制 - 默认为5)。

最终解决方案可以在webjobs.ricardogaefke.com上找到,并且有一个How it works页面包含指向 GitHub 存储库、公共 Azure Pipelines 和公共 Docker 注册表的链接。

于 2020-05-31T16:24:58.430 回答