Practice Questions for 70-583: Design a queue strategy that guarantees idempotency.

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

while (true)
{
taskMessage = TaskQueue.GetMessage(QueueTimeout);

if (taskMessage != null)
{
task = new Task(taskMessage);
DoTask(task);
TaskQueue.DeleteMessage(taskMessage);
}
else
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?

  1. Remove the offending line from the application. Once an item has been dequeued, there is no need to delete the item from the queue.
  2. Wrap the while block in a Try-Catch block and retry the operation.
  3. Increase the QueueTimeout value so the message remains invisible longer.
  4. Decrease the QueueTimeout value so the message becomes visible and can be deleted.

Leave a Reply

Name *
Email *
Website