Cloud Zone is brought to you in partnership with:

Mikael is the founder of Adafy Oy, a Finnish software startup providing development services for Windows Phone, Windows 8 and Windows Azure. Adafy is available for hire: www.adafy.com. Mikael is a DZone MVB and is not an employee of DZone and has posted 46 posts at DZone. You can read more from them at their website. View Full User Profile

Azure Service Bus: The Dead Letter Queue

01.29.2013
| 3080 views |
  • submit to reddit

I’ve been processing a lot of messages through Azure Service Bus lately. During that processing I encountered a situation where Azure Management Portal reported that there were over 97 thousand messages in the queue but still the worker weren’t receiving any messages.

image

Turns out the Management Portal also reports messages in the Dead Letter Queue. Some of the messages had failed the processing few times so they had been automatically moved to the Dead Letter Queue.

Here’s a code snippet for creating a QueueClient for the DLQ, from a previously created QueueClient:

var client = QueueClient.CreateFromConnectionString(conn, queue);
...
 
if (deadLetter)
{
var dfQueue = QueueClient.FormatDeadLetterPath(client.Path);
var dfClient = QueueClient.CreateFromConnectionString(conn, dfQueue);
}



Published at DZone with permission of Mikael Koskinen, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)