Solved

Purge MSMQ based on Date

Posted on 2014-07-22
5
232 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
[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: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 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: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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

622 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