我在 azure 函数中观察到这个奇怪的问题,该问题是由服务总线队列消息触发的。
Azure 函数持续运行
,当服务总线队列收到新消息时触发
。
but when there is no message into queue for long time like suppose 1-2 days and when new message come into queue after 2 days ,Its strange that azure function does not get triggered , why any clue?
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 Functions,这是一个已知问题。另外,请验证您是否看到死信队列中的消息。
通过启用“始终开启”来防止您的 Azure Function 闲置:在 Azure 门户中打开您的 Function App。单击 Function App 边栏选项卡顶部的 Function App 设置。滚动到页面底部,然后单击“转到应用程序服务设置”。在“设置”边栏选项卡中,向下滚动并单击“应用程序设置”。在“应用程序设置”边栏选项卡中,确保“始终打开”设置已设置为“打开”。
关于c# - 当消息在几天后进入服务总线队列时,Azure 函数不会被触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52089883/