Thanks for your answer, I'll try extracting the messages manually.

There is one more twist... If I insert a Thread.Sleep(100) just after
sending the message to the queue, now all messages show in the SnapIn
regardless how many were sent, under this conditions it seems there is no
limit (WinXP) in how many msgs can show.

Wagner
>Andover Controls Corp
>www.andovercontrols.com


At 07:18 AM 6/14/2002 -0500, you wrote:
>The missing messages are in the queue.  The MMC snap-in doesn't show all
>the messages in the queue after the number of messages reaches a certain
>point (and that point was about 1000 on Windows 2000, haven't tried it
>on Windows XP).  Because you are altering the priority of the messages
>randomly, you won't be able to predict which messages will show up in
>the snap-in.
>
>Write a bit of code to count the messages in the queue and you will see
>that they are really there.
>
>-----Original Message-----
>From: wagner [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, June 13, 2002 9:45 AM
>To: [EMAIL PROTECTED]
>Subject: [ADVANCED-DOTNET] MSMQ and the missing messages
>
>Win XP, Pentium IV, C# SP1
>
>I have the following console program which sends messages to a local
>private queue:
>         class Class1
>         {
>                 private static int m_nMsgLimit = 2000;
>         static void Main(string[] args)
>         {
>                  // get/create the private queue
>                  string queueName = ".\\private$\\TryMQQueue";
>                          MessageQueue msgQ;
>                     if(!MessageQueue.Exists(queueName))
>                            msgQ = MessageQueue.Create(queueName);
>                         else
>                  {
>                   msgQ = new MessageQueue(queueName, false);
>                       msgQ.Purge();
>                          }
>                  // Send Msgs
>                          Random random = new Random();
>                  for(int i = 0 ;i < m_nMsgLimit ; i++)
>                          {
>                 System.Messaging.Message msg = new
>System.Messaging.Message();
>                     msg.Label = "MsgLabel_" +
>i.ToString().PadLeft(5,'0');
>                 msg.Priority = (MessagePriority)random.Next(1,8);
>                     msg.Body = msg.Label;
>                 Console.WriteLine(msg.Label);
>                     msgQ.Send(msg);
>                         }
>        }
>        }
>
>If the number of messages sent are 1000 (m_nMsgLimit  set to 1000) all
>messages are accounted for when using the MSMQ SnapIn viewer.  Now, if
>m_nMsgLimit  is set to 2000, almost half of the messages are missing, in
>an
>almost random way, for example, 1, 3, 7, 8 are there but, 2, 4,5,6, 9
>are
>not.  I have tried in a couple of machines with the same results, and a
>couple of developers went over the code and MSMQ settings, but found
>nothing wrong... am I missing something?
>
>Thanks for your help.
>
>Wagner Alcocer
>Andover Controls Corp
>www.andovercontrols.com
>
>You can read messages from the Advanced DOTNET archive, unsubscribe from
>Advanced DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
>You can read messages from the Advanced DOTNET archive, unsubscribe from
>Advanced DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to