Solved

Purge MSMQ based on Date

Posted on 2014-07-22
5
204 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now