0
votes

I'm working on a project where we would like to use ServiceBus like a classical queue, for messaging. Very often I see messages in queue that I can't get. These messages are active (not dead letters). I don't receive any exceptions, it waits for timeout and then message is null without any issues. I've already checked size of messages but all are less then 1.5 KB.

try
...
QueueClient _queueClient = QueueClient.CreateFromConnectionString(Properties.Settings.Default.ServiseBusConnectionString, Properties.Settings.Default.StatQueueName);

var count = 1000;

for (var i = 1; i <= count; i++)
{
 var message = _queueClient.Receive();
 //timeout 
 if (message == null)
 {
  //message is null :(
  continue;
 }
}
...
catch
1
Have you tried using the Azure ServiceBus explorer to retrieve the messages? blogs.msdn.com/b/paolos/archive/2014/12/04/… - viperguynaz

1 Answers

0
votes

Read How to receive messages from a queue and make sure you use _queueClient.Complete() or _queueClient.Abandon() to finish with each message.