question about MessageQueue
Hi, friends:
I try to send a message into MSMQ and then read it out.
But I find the message is not be removed after being accessed.
How can I read and remove it ?
Thanks
Charles Shao
=============== =============== =============== =============== ====
myNewPrivateQue ue1.Send("My message data.",
MessageQueueTra nsactionType.Si ngle);
MessageEnumerat or myEnumerator =
myNewPrivateQue ue1.GetMessageE numerator();
// Specify that the messages's priority should be read.
myNewPrivateQue ue1.MessageRead PropertyFilter. Priority = true;
// Move to the next message and examine its priority.
while(myEnumera tor.MoveNext())
{
// Increase the count if priority is Lowest.
if(myEnumerator .Current.Priori ty ==
MessagePriority .Lowest)
Console.WriteLi ne("Received MSG: " +
myEnumerator.Cu rrent.Body.ToSt ring());
}
Hi, friends:
I try to send a message into MSMQ and then read it out.
But I find the message is not be removed after being accessed.
How can I read and remove it ?
Thanks
Charles Shao
=============== =============== =============== =============== ====
myNewPrivateQue ue1.Send("My message data.",
MessageQueueTra nsactionType.Si ngle);
MessageEnumerat or myEnumerator =
myNewPrivateQue ue1.GetMessageE numerator();
// Specify that the messages's priority should be read.
myNewPrivateQue ue1.MessageRead PropertyFilter. Priority = true;
// Move to the next message and examine its priority.
while(myEnumera tor.MoveNext())
{
// Increase the count if priority is Lowest.
if(myEnumerator .Current.Priori ty ==
MessagePriority .Lowest)
Console.WriteLi ne("Received MSG: " +
myEnumerator.Cu rrent.Body.ToSt ring());
}
Comment