Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Purge MSMQ based on Date

Posted on 2014-07-22
5
Medium Priority
?
256 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:James Atkin
  • 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:James Atkin
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 2000 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:James Atkin
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

927 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