I’ll be posting practice questions for the 70-583: PRO: Designing and Developing Windows Azure Applications certification all week. I haven’t seen the test, and I apologize if these questions aren’t representative of the actual exam, however, they focus on the topics outlined by Microsoft.
You are creating a Windows Azure Worker role that contains the following code
taskMessage = TaskQueue.GetMessage(QueueTimeout);
if (taskMessage != null)
task = new Task(taskMessage);
Thread.Sleep(SleepInterval * 1000);
The role has crashed repeatedly and when you review the logs you see a ClientStorageException with the following ErrorCode: MessageNotFound and an HTTP Status 404. The StackTrace shows the TaskQueue.DeleteMessage call is causing the exception. What should you do to fix the application?
- Remove the offending line from the application. Once an item has been dequeued, there is no need to delete the item from the queue.
- Wrap the while block in a Try-Catch block and retry the operation.
- Increase the QueueTimeout value so the message remains invisible longer.
- Decrease the QueueTimeout value so the message becomes visible and can be deleted.