I'm trying to solve a problem where multiple queues (i.e. one queue per month) is created on Azure Service Bus. The messages in the queue contains information about customer billings. The queues are created like this:
/// <summary>
/// Creates a new queue on Azure Service Bus
/// </summary>
/// <param name="queueName">string</param>
/// <returns>string (name of created queue)</returns>
public string CreateNewQueue(string queueName)
{
try
{
NamespaceManager manager = NamespaceManager.Create();
if (!manager.QueueExists(queueName))
{
manager.CreateQueue(queueName);
return queueName;
}
return string.Empty;
}
catch (Exception e)
{
Logging.Instance.Fatal(e.ToString());
return string.Empty;
}
}
After the queue is created, about 3.000 messages with billing-info (only database ids of the billings, though) are added to the queue.
For processing the queues, I'd like to make use of the Azure Worker Role. I've created an Azure Service project and added a Worker Role with Service Bus Queue
worker role to the project.
Now, in the Run()
method of the Worker Role, "only" a single queue is used (taken from sample code):
// The name of your queue
const string QueueName = "ProcessingQueue";
I've got a feeling that I'm working against the norm here, by creating a new queue for each billing task :-) However, a new queue is certainly needed since it's critical to track each billing task every month.
Is there any way to couple the Worker Role with the before mentioned dynamically created queues?
Thanks in advance.