Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

queenClient.ReceiveBatch(IEnumerable) throw MessageNotFoundException

$
0
0

Hi All,

     I want to use queueClient.ReceiveBatch(IEnumerable<long>) to remove brokenmessage from deadletter queue,below is my 

     code:

           

            bool success = false;
            if(messagingFactory == null)
                throw new NullReferenceException("messsagingFactory is null");
            try
            {
                QueueClient client = messagingFactory.CreateQueueClient(QueueClient.FormatDeadLetterPath(queuepath),                             ReceiveMode.ReceiveAndDelete);
                if (sequenceNumbers != null)
                {
                    client.ReceiveBatch(sequenceNumbers);
                }
                return true;
            }
            catch(Exception ex)
            {
                throw ex;
            }

 

          when above codes are executed,below exceptions is thrown:

          MessageNotFoundException:Failed to lock one or more specified messages.The message  doesn't exist.

         but I check that the SequenceNumbers are as the same as the brokenMessage. why throw this exception?         

         

   

   


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>