I have an Azure worker role that is responsible for checking 4 service bus queues. Currently, I just the looping method to manually check the queues.
while(true)
{
//loop through my queues to check for messages
}
With the Azure SDK 2.0 came the ability to listen for messages rather than polling for them. But Every example I've seen uses a console app with Console.ReadKey(). Is there a way to have the worker role sit and wait on messages too?
I tried:
public override void Run()
{
_queueProcessors.ForEach(x => x.OnMessage(Process);
}
where _queueProcessors is a list of QueueClients and Process is a private method that handles the messages. However, the worker role would register them and then restart.
So anyone know how to make a queue client sit and wait on a message?