Over a million developers have joined DZone.
Platinum Partner

Azure Service Bus: The Dead Letter Queue

· Cloud Zone

The Cloud Zone is brought to you in partnership with Mendix. Better understand the aPaaS landscape and how the right platform can accelerate your software delivery cadence and capacity with the Gartner 2015 Magic Quadrant for Enterprise Application Platform as a Service.

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);
}



The Cloud Zone is brought to you in partnership with Mendix.  Learn more about The Essentials of Digital Innovation and how it needs to be at the heart of every organization.

Topics:

Published at DZone with permission of Mikael Koskinen , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}