I have an Azure Service Bus queue with 236 messages in the dead-letter sub-queue. I know this because the Azure Portal and Service Bus Explorer show me that number.
I wrote the following in LINQPad to retrieve all 236 messages and examine them. However it only ever returns 136 of the 236 messages.
I'm using v5.1.0 of the Microsoft.Azure.ServiceBus nuget package.
Any thoughts as to why I'm not getting all 236 messages?
const string queueName = "the-queue-name";
const string serviceBusConnectionString = "Endpoint=...";
var receiver = new MessageReceiver(serviceBusConnectionString, EntityNameHelper.FormatDeadLetterPath(queueName));
var receivedMessages = await receiver.PeekAsync(300);
Console.WriteLine($"Received [{receivedMessages.Count()}] dead-letters");