Solved

Purge MSMQ based on Date

Posted on 2014-07-22
5
224 Views
Last Modified: 2014-07-27
Hi all,

I am using a MSMQ in a C# application.
The data it posts to the queue will grow over time, until the application it is targeting is launched.
It is possible for the application that is adding the messages to the queue, to also remove them after they have been laying there for a period of time?
Any ideas would be appreciated.
Many thanks,
James
0
Comment
Question by:jatkin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:Jeroen Timmermans
ID: 40211736
You could consider validating the queue-size and manually removing messages if it reaches a certain threshold before posting a new message.
0
 
LVL 4

Author Comment

by:jatkin
ID: 40214082
Thanks for the reply.
This would be a possibility, but unfortunately it does not really achieve what I am after.
I need the queue to have any messages that were generated, for example, in the last hour.
As time moves on, the old messages would be scrapped leaving only ones posted in the last hour.

I don't even know if this is possible using the MSMQ, and TBH I do see that it is not really what it is aimed at.
Just thought it was a powerful and simple API that I could use to perform this task.
0
 
LVL 5

Accepted Solution

by:
Jeroen Timmermans earned 500 total points
ID: 40214092
I don't know whether MSMQ can handle that task. If you are willing to invest time and effort in alternatives, have a look at RabbitMQ, I believe it has a configuration where you can specify the TTL for each type of message.
0
 
LVL 4

Author Comment

by:jatkin
ID: 40223526
Thanks for the input.
I was really trying to avoid any 3rd party components, and was hoping that the integrated MSMQ would do what I was after.
Done some further reading and cannot see any way that it will deal with what I am looking at.
The RabbitMQ however does appear to be pretty good, so I will investigate this further,
Thanks again for the help,
James
0
 
LVL 5

Expert Comment

by:Jeroen Timmermans
ID: 40223530
Glad I could help. On the topic of avoiding 3rd party components; Microsoft themselves have embraced the use of 3rd party libraries and tools, since they can't handle everything themselves. In fact; in ASP vNext, they've implemented a simple DI-container, but htey do encourage the use of 3rd party containers.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question