Solved

Purge MSMQ based on Date

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 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

16 Experts available now in Live!

Get 1:1 Help Now