简体   繁体   English

中毒队列的到期日期

[英]Expiration date of poison queue

如何在Azure存储队列中将毒物队列消息的到期日期期限更改为最大,当前默认情况下的到期时间为7天。

AFAIK, the maximum allowed expiration time for Azure Queue message is 7 days, which is also the default value. AFAIK,Azure Queue消息允许的最长到期时间为7天,这也是默认值。

The poison queue is also a normal queue named {original-queue-name}-poison . 中毒队列也是一个名为{original-queue-name}-poison的普通队列。 For example, if Azure Webjobs SDK handles a queue message exceeding the maximum number of attempts, then the related message would be moved to a poison queue, and this process is handled by the SDK. 例如,如果Azure Webjobs SDK处理的队列消息超过最大尝试次数,则相关消息将被移至有毒队列,并且此过程由SDK处理。

Per my understanding, you need to explicitly handle the poison messages instead of storing the messages into the poison queue permanently. 根据我的理解,您需要显式处理有毒消息,而不是将消息永久存储到有毒队列中。 Details you could follow How to handle poison messages . 您可以遵循的详细信息如何处理有毒消息 Moreover, you could choose other Message Queuing services to meet your requirement. 此外,您可以选择其他消息队列服务来满足您的要求。


UPDATE: 更新:

As changelog.txt about changes in 9.0.0: 关于9.0.0中的更改的changelog.txt文件

Queues: Added support for infinite TTL on queue messages. 队列:添加了对队列消息上的无限TTL的支持。

You could specify the timeToLive parameter when adding the queue message as follows: 您可以在添加队列消息时指定timeToLive参数,如下所示:

 queue.AddMessage(new CloudQueueMessage($"hello world-{DateTime.UtcNow}"),timeToLive:TimeSpan.MaxValue); 

For your requirement, you could use the manual poison message handling approach to check the dequeueCount and explicitly add the current queue message into the poison queue programmatically. 根据您的要求,您可以使用手动带毒消息处理方法来检查dequeueCount并以编程方式将当前队列消息显式添加到带毒队列中。

Note: The maximum number of retries before a queue message is sent to a poison queue is 5 by default, you could change it via config.Queues.MaxDequeueCount . 注意:默认情况下,将队列消息发送到毒物队列之前的最大重试次数为5,您可以通过config.Queues.MaxDequeueCount更改。

Or you just leverage the automatic poison message handling, then you could trigger the relevant poison queue and add the queue message into your custom poison queue with the infinite TTL. 或者,您只是利用自动的毒害消息处理功能,就可以触发相关的毒害队列,并将队列消息添加到具有无限TTL的自定义毒害队列中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM