c# - Azure 服务总线 AutoDeleteOnIdle

标签 c# .net azure azureservicebus azure-servicebus-queues

我想创建一个分区队列,我一直在阅读这个网站: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/

相关文章:

c# - 在 Linux 上使用 .NET/Mono 来提供大容量 Web 服务,是个好主意吗?

c# - 将模型变量绑定(bind)到 ASP.NET MVC3 中的操作方法

c# - WebBrowser 控件中的 Google 字体仅在外部为 "helped"时显示

c# - "&"字符破坏了存储在 web.config 中的密码

.net - 嵌套 UpdatePanel 触发器

azure - 属性错误: 'str' object has no attribute 'cloud'

azure - 诊断 Azure 有状态参与者

c# - C#中的隐式类型转换

c# - 我如何预先设置流?

azure - 如何使 Azure AD 身份验证接受 url 查询字符串访问 token