• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

Reading Messages from MSMQ

Hi

I am totally new to MSMQ. My requirement is something like this:
I know the path of message queue and i have to go through all the messages in that queue every 10 min....and check if there is any message which came in and is not proccessed and still is in queue for more than 10 min...then i have to perform certain functions or say display an alert message to user.

How do i read the message list and check the time it is being lying in the queue.

Some sample code would be great. My application is in C# ASP.NET 2.0

Mahesh
0
ziorrinfotech
Asked:
ziorrinfotech
  • 2
1 Solution
 
DhaestCommented:
Code Snippet: Receiving a message in the .NET service:
MessageQueue MyMessageQ;
Message MyMessage;
MyMessageQ = new MessageQueue(_QueuePath);
MyMessage = MyMessageQ.Receive;      
WriteStatus("Message Received!");
DoSomeLongRunningProcess();
WriteStatus("Processing Finished!");

Source: Leveraging MSMQ in ASP.NET Applications
http://www.15seconds.com/Issue/031202.htm



How to do asynchronous programming using ASP.NET, MSMQ and Windows Service, for long running processes
http://www.codeproject.com/dotnet/Using_MSMQ_ASPnet_Window.asp
0
 
ziorrinfotechAuthor Commented:
when i unse sendtime property of message it give me exception and give this msg please use correct property filer in the reciveced mesage.
so how i get the send time of the message
0
 
ziorrinfotechAuthor Commented:
I got it..i also have to set MsgQ.MessageReadPropertyFilter.ArrivedTime = true;
before reading it.
0
 
tppradeep18Commented:
@ i also have to set MsgQ.MessageReadPropertyFilter.ArrivedTime = true;
great efforts dude !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now