Avatar of Berico
BericoFlag for United States of America

asked on 

MSMQ active message

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)
        {
           
           
            try
            {
             
                incomingmessage = MyQueue.EndReceive(e.AsyncResult);
                incomingmessage.Formatter = new BinaryMessageFormatter();
                sendemail.sendqueuemail(incomingmessage);
                //During this stage when mail is being sent my external
               // application need to know the ID of the message
       
            }
            catch
            {
               

            }
            finally
            {
               // remove the message from the queue if its matches
                 EBTSQueue.Receive();
                 //refresh the Queue
                 EBTSQueue.Refresh();
                // start watching for another message
                EBTSQueue.BeginPeek();
            }
        }
C#.NET Programming

Avatar of undefined
Last Comment
Maulik Modi
ASKER CERTIFIED SOLUTION
Avatar of Maulik Modi
Maulik Modi

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Maulik Modi
Maulik Modi

Please tell me which approach you finally decided to go with.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo