0

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
AChudov
  • 214
  • 1
  • 4
  • Have you tried using the Azure ServiceBus explorer to retrieve the messages? http://blogs.msdn.com/b/paolos/archive/2014/12/04/service-bus-explorer-2-5-now-available.aspx – viperguynaz Feb 24 '15 at 03:43

1 Answers1

0

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

viperguynaz
  • 12,044
  • 4
  • 30
  • 41
  • Yes, I do complete or abandon, I showed just part of code. If you don't do it in 30 sec timeout, message will be marked as dead-letter. – AChudov Feb 24 '15 at 05:35
  • AFAIK default TTL in a queue is quite infinite (using Visual Studio you can see 10675199.02:48:05.4775807 as value in DefaultMessageTimeToLive). Can you check this value in your queue ? – ppatierno Feb 24 '15 at 11:06