如果 Azure 函数超时,触发消息是否放回 Azure 队列?
If Azure function times out, is the trigger message put back on the Azure queue?
或者该行为仅在函数出错时可用。
这是队列触发函数。
如果函数完成且没有任何错误,该函数会自动将消息标记为已完成并将其从队列中删除。
否则,邮件将放回队列中。这将使它可见以再次处理。但是,请记住,每次处理消息时,DeliveryCount
都会递增。如果 DeliveryCount
超过队列的 MaxDeliveryCount
,则消息将移至 Dead Message 子队列。
如 Mikhail 所述,函数会自动重试 5 次处理消息。如果重试 5 次后失败,它将自动移至毒物队列 <queuename>-poison
.
以下两篇相关文章更清楚地说明了消息队列和处理方式
这是一些关于 handling poison queue messages 的文档。
希望这能为您澄清一些事情。
根据我的测试,是的,如果 azure 函数超时,消息似乎会无限期地返回到队列。
这是我提交 8 小时后的消息信息:
插入时间
2018 年 7 月 9 日,星期一 16:04:33 GMT
过期时间
2018 年 7 月 16 日星期一 16:04:33 GMT
出队计数
29
这个 MSDN 页面 https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages 说 "The two triggers that have retry support are Azure Queue storage and Azure Blob storage. By default, these triggers are retried up to five times. After the fifth retry, both triggers write a message to a special poison queue."
此错误行为在函数超时的情况下不成立;我的消息已重试 29 次并且还在计数!
或者该行为仅在函数出错时可用。
这是队列触发函数。
如果函数完成且没有任何错误,该函数会自动将消息标记为已完成并将其从队列中删除。
否则,邮件将放回队列中。这将使它可见以再次处理。但是,请记住,每次处理消息时,DeliveryCount
都会递增。如果 DeliveryCount
超过队列的 MaxDeliveryCount
,则消息将移至 Dead Message 子队列。
如 Mikhail 所述,函数会自动重试 5 次处理消息。如果重试 5 次后失败,它将自动移至毒物队列 <queuename>-poison
.
以下两篇相关文章更清楚地说明了消息队列和处理方式
这是一些关于 handling poison queue messages 的文档。
希望这能为您澄清一些事情。
根据我的测试,是的,如果 azure 函数超时,消息似乎会无限期地返回到队列。
这是我提交 8 小时后的消息信息:
插入时间 2018 年 7 月 9 日,星期一 16:04:33 GMT
过期时间 2018 年 7 月 16 日星期一 16:04:33 GMT
出队计数 29
这个 MSDN 页面 https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages 说 "The two triggers that have retry support are Azure Queue storage and Azure Blob storage. By default, these triggers are retried up to five times. After the fifth retry, both triggers write a message to a special poison queue."
此错误行为在函数超时的情况下不成立;我的消息已重试 29 次并且还在计数!