I have recently written some code which processes dead letter queue messages from azure service bus into a report.
I'm trying to test that code by uploading lots and lots of messages to a deadletter queue for it to process.
I've put together a c# linqpad / console app that reads a folder of text files and tries to send each one as a message to my testqueue/$deadletters using the Azure.Messaging.ServiceBus client library which looks like this:
var files = Directory.GetFiles(messagePath,filePattern);
var client = new ServiceBusClient(connectionString);
var dlqSender = client.CreateSender($"{queueName}/$deadletterqueue");
foreach (var file in files)
{
var msgBody = File.ReadAllText(file);
var message = new ServiceBusMessage(msgBody);
await dlqSender.SendMessageAsync(message);
}
Unfortunately, this just freezes on the dlqSender.SendMessageAsync line for the 1st message and never resumes. Theres No error message and nothing goes into the DLQ or queue.
I appreciate it might be an odd usage scenario but I thought the DLQ behaved like any other queue. It would be good to get some confirmation that this is supported.