WebJobs不重试失败的队列消息

时间:2014-06-27 12:39:00

标签: azure-web-sites azure-webjobs azure-webjobssdk

我在使用新的0.3.0-beta WebJobs SDK的WebJob中有以下逻辑。当我的代码处理消息失败时,Azure仪表板显示聚合异常(这是有道理的,因为这是异步)。但是,它不会重试处理消息。

我能找到的documentation非常小,表明该消息应在失败后的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

0 个答案:

没有答案