MSMQ active message

Berico used Ask the Experts™
I have written a windows service and process messages in a queue and sends and email per each message. I am also writing a windows application that monitors this queue and should determine which message is currently being send. Is there any way to look at a queue externally and determines which message is currently active. This is my winodws service peekcompeleted method:

 private void MyQueue_PeekCompleted(object sender, PeekCompletedEventArgs e)
                incomingmessage = MyQueue.EndReceive(e.AsyncResult);
                incomingmessage.Formatter = new BinaryMessageFormatter();
                //During this stage when mail is being sent my external
               // application need to know the ID of the message

               // remove the message from the queue if its matches
                 //refresh the Queue
                // start watching for another message
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
There is no event that you can use in external application to detect MSMQEvent.Received.

Perhaps, you can maintain status table in backend with timestamp or create text file for each message with comma separated values in a folder that is under watch by windows application. You can use FileSystemWatcher to watch a folder, as soon as windows application finishes you can delete that text file.

other pointers:
Please tell me which approach you finally decided to go with.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial