简体   繁体   English

Azure存储队列中的Web作业失败未写入Poison Queue

[英]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.

相关问题 Azure 存储队列 - 处理有害队列上的消息 - Azure Storage Queue - processing messages on poison queue Azure 队列存储 Visual Studio 本地主机从 QueueClient 发送的所有队列消息进入毒队列 - Azure Queue Storage visual studio local host all queue messages sent from QueueClient going to poison queue Azure 存储毒物队列怎么看超出前32条消息? - Azure storage poison queue how to see beyond the first 32 messages? 队列消息未移至中毒队列 - Queue messages not being moved to the poison queue 一段时间后,Azure存储队列消息立即全部移至中毒队列 - Azure storage queue messages are moved all at once to poison queue after a period of time 可恢复的Azure Web作业(不要从队列中删除) - Recoverable Azure Web Job (don't delete from queue) 使用存储队列和服务总线时,Azure 死信队列和毒药队列有什么区别? - What is the difference between Azure Dead Letter Queues and Poison Queues when using Storage Queue and Service Bus? 为 Azure 设置 TTL 队列项目移至毒物队列 - Setting the TTL for Azure Queue items moved to poison queue 我可以查询Azure Web作业队列吗? - Can I query the Azure web job queue? 从 Azure Function 中取出 Azure 存储队列 - Dequeue Azure Storage queue from Azure Function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM