我观察到由服务总线队列消息触发的azure函数的这个奇怪问题。
Azure function is continuous running
这是trigger when service bus queue gets new message
。
但是当假设1-2天长时间没有消息进入队列,而两天后又有新消息进入队列时,天青函数没有被触发很奇怪,为什么有任何线索?
public static class TestController
{
[FunctionName("TestController")]
public static async Task Run([ServiceBusTrigger("%TestController.Topic%", "%TestController.Subscription%", AccessRights.Listen,
Connection = "ConnServiceBus")]BrokeredMessage currentMessage, TraceWriter log, ExecutionContext context)
{
log.Info("TestControllerprocessing start " + DateTime.Now);
按下“刷新”按钮,尝试强制重新同步触发器。对于闲置了不确定时间段的Azure功能,这是一个已知问题。另外,验证您是否在死信队列中看到消息。
通过启用“始终打开”来防止Azure功能闲置开始:在Azure门户中打开Function App。单击“功能应用程序”刀片顶部的“功能应用程序设置”。滚动到页面底部,然后单击“转到应用程序服务设置”。在“设置”刀片中,向下滚动并单击“应用程序设置”。在“应用程序设置”刀片中,确保将“始终打开”设置设置为“打开”。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句