[英]Failed Web Job from Azure Storage Queue not being written to Poison Queue
I have an Azure Web Job which is working by processing new items on an Azure storage queue. 我有一个Azure Web作业,它通过处理Azure存储队列中的新项目来工作。 That is working. 那很有效。 I have set the MaxDequeueCount to a low number, and once an operation triggered by a queue has failed that many times, I expect that this item on the queue to be moved to a poison queue. 我已将MaxDequeueCount设置为较小的数字,并且一旦队列触发的操作多次失败,我希望队列中的此项目移动到毒性队列。
However, that is not happening. 但是,这种情况并没有发生。 The item gets removed from the queue, and there is no poison queue nor this message in any poison queue. 该项目从队列中删除,并且任何毒物队列中都没有毒物队列也没有此消息。 What is wrong here, as I am unaware of any other steps required in order to have the message "pushed" to a poison queue. 这里有什么问题,因为我不知道为了将消息“推送”到毒性队列所需的任何其他步骤。
public static async Task ProcessQueueMessage([QueueTrigger("myQueue")] CloudQueueMessage message, TextWriter log)
{
try
{
throw new InvalidCastException();
}
catch (Exception exception)
{
log.WriteLine($"Exception in ProcessQueueMessage: {exception}");
throw;
}
}
The message will move to the poison queue only if there is an unhandled exception. 仅当存在未处理的异常时,该消息才会移至毒性队列。 Using a try-catch error is not the case. 使用try-catch错误并非如此。 What you can do is to move the message to the poison queue manually in your catch section. 您可以做的是在catch部分中手动将消息移动到毒性队列。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.