Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure service bus dead letter queues

I am using azure service bus topic and subscription mechanism and want to process the messages which are all in the dead letter queue.

Moreover i want to process the messages via azure web job in C# and send them back to queue. So i want to know how I can process the messages on the deadletter queue through my application?

like image 892
MathuSuthanan Avatar asked Oct 20 '17 10:10

MathuSuthanan


2 Answers

When a message is deadlettered it goes onto the dead letter queue for the subscription from which it was read. You access that just like you'd access the original subscription except that you append /$DeadLetterQueue to the subscription name.

like image 159
spodger Avatar answered Sep 28 '22 08:09

spodger


Moreover i want to process the messages via azure web job in C# and send them back to queue.

As spodger pointed that the path of your deadletter subscription would be:

{topic-path}/Subscriptions/{subcription-name}/$DeadLetterQueue

You could use the WebJobs SDK for Service Bus and leverage the ServiceBusTrigger to access your dead letter queue message(s) as follows:

public void ProcessDeadletterQueue(
    [ServiceBusTrigger("topicName", "subscriptionName/$DeadLetterQueue")] BrokeredMessage message)
{
    //TODO:
}

For more details, you could refer to here.

like image 45
Bruce Chen Avatar answered Sep 28 '22 08:09

Bruce Chen