user2413912
user2413912

Reputation: 599

Azure Service Bus AutoDeleteOnIdle

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);
    }
}

Upvotes: 3

Views: 2355

Answers (2)

Seth Manheim - MSFT
Seth Manheim - MSFT

Reputation: 309

Thank you for catching this! I'll make sure the docs are updated. I've confirmed with the development team that you'll get the exception if AutoDeleteOnIdle is set to any value (and EnablePartitioning is TRUE).

--Seth Manheim

Microsoft Azure Documentation Team

Upvotes: 3

BrentDaCodeMonkey
BrentDaCodeMonkey

Reputation: 5513

It appears to simply be an error in the documentation. If you don't specify property when creating your queue description, you shouldn't have any issues.

I'll make sure the right folks see the documentation issue. :)

Upvotes: 2

Related Questions