MessageQueue

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

Does anyone know of a simple way to get the total number of messages in a
MessageQueue? I thought it would have a count property or something of the
like but I have been able to find anything.

Thanks,

Matt
 
This should do the job:

MessageQueue m = new MessageQueue(path);
Message[] message = m.GetAllMessages();
int count = message.Length;
 
BC,

I guess I should add I need a non-destructive way of getting the message
count. I need this process to leave the existing messages alone as I am
constructing an alert system to let me know if any of my queues have unusual
high levels of activity.

The method you describe removes all of the messages from the queue, doesn't
it?

Thanks,

Matt
 
Back
Top