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