gpt4 book ai didi

c# - Azure 服务总线 AutoDeleteOnIdle

转载 作者:行者123 更新时间:2023-12-02 00:06:50 28 4
gpt4 key购买 nike

我想创建一个分区队列,我一直在阅读这个网站:http://msdn.microsoft.com/en-us/library/azure/dn520246.aspx

In its current implementation, Service Bus imposes the following limitations on partitioned queues and topics:

  • Partitioning of queues or topics does not enable automatic deletion when idle. Service Bus returns an InvalidOperationException if any of the following conditions occur:
    • You attempt to create a queue for which the Microsoft.ServiceBus.Messaging.QueueDescription.AutoDeleteOnIdle and Microsoft.ServiceBus.Messaging.QueueDescription.EnablePartitioning properties are both set to true.

但是AutoDeleteOnIdle是一个TimeSpan。它们是指其他属性(property)吗?或者我是否将 TimeSpan 设置为 0 或 -1 刻度?根据http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.queuedescription.autodeleteonidle.aspx最短持续时间为 5 分钟。无论如何,我并不是在寻找任何自动删除功能。我应该忽略它吗?

public static void CreateQueueIfNotExist(string queueName)
{
if (namespaceManager == null)
namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
if (!namespaceManager.QueueExists(queueName))
{
QueueDescription qDescription = new QueueDescription(queueName);
qDescription.DefaultMessageTimeToLive = new TimeSpan(14, 0, 0, 0);
qDescription.LockDuration = new TimeSpan(0, 5, 0);
qDescription.EnablePartitioning = true;
qDescription.RequiresDuplicateDetection = false;
qDescription.AutoDeleteOnIdle = ???????????; // TODO
namespaceManager.CreateQueue(qDescription);
}
}

最佳答案

感谢您收看此内容!我会确保文档已更新。我已与开发团队确认,如果 AutoDeleteOnIdle 设置为任何值(并且 EnablePartitioning 为 TRUE),您将会遇到异常。

--赛斯·曼海姆

Microsoft Azure 文档团队

关于c# - Azure 服务总线 AutoDeleteOnIdle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25563145/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com