Search code examples
azuremessage-queueservicebus

Azure Service Bus have message in it base on Queue Length, but I cannot receive or peek message.


In Azure Service Bus / Queue. I found there are numbers of message in the queue, base on the Queue Length is not 0. But I cannot receive or peek message from the queue.

var receivedMessages = Client.ReceiveBatch(1);

Is there any one having this problem?


Solution

  • One thing to check, have you dead-lettered any messages? they appear to still be in the queue but you cannot receive them. Perhaps add another message and see if you can get that one out.

    I also had a situation where it just stopped receiving messages after I updated the dll with nuget. I had to recreate the queue in the service bus and it started working again.

    One last thing, have you set up individual access on each queue with it's own shared access key? I was getting issues when using the global access key for my service bus, but they also seemed to go away after setting this up.

    Hopefully one of these will help.