MessageQueue GetAllMessages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am tying to get all of the messages in a MessageQueue using GetAllMessages
but it not only is taking a long time but eventually I get:

There are 2 messages in the failed queue.

failed: System.Messaging.MessageQueueException : Invalid parameter was
passed to a function.
at System.Messaging.MessageEnumerator.MoveNext(TimeSpan timeout)
at System.Messaging.MessageEnumerator.MoveNext()
at System.Messaging.MessageQueue.GetAllMessages()

First I want to know how many object are in the queue (without changing it).
Next I want to get all of the objects from the queue (without changing it).

Apparently GetAllMessages() is not the way to do this. Any suggestions?

Thank you.

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top