我在使用新的 0.3.0-beta WebJobs SDK 的 WebJob 中有以下逻辑。当我的代码无法处理消息时,Azure 仪表板会显示一个聚合异常(这是有道理的,因为这是异步的)。但是,它不会重试处理该消息。
我能找到的极少文档表明该消息应在失败后 10 分钟内重试。新的SDK不是这样吗?
public static Task ProcessMyMessageAsync(
[QueueTrigger(Config.MY_QUEUE)] string msg,
int dequeueCount,
CancellationToken cancellationToken)
{
var processor = Config.Container.GetInstance<IMessageProcessor>();
return processor.HandleJobAsync(msg, dequeueCount, cancellationToken);
}
我得到的异常源于 SQL Timeout 异常(它在我的代码中是针对 SQL Azure 的 db 查询):
System.AggregateException: System.AggregateException: One or more errors occurred.
---> System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details.
---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
---> System.ComponentModel.Win32Exception: The wait operation timed out