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.

Reply via email to