I want to make a partitioned queue and I've been reading this website: 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.
But AutoDeleteOnIdle
is a TimeSpan. Do they mean another property? Or do I set the TimeSpan to 0 or -1 ticks? According to http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.queuedescription.autodeleteonidle.aspx the minimum duration is 5 minutes. I'm not looking for any auto deletion functionality anyhow. Should I ignore it?
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);
}
}