Is there a way to check how many messages are in a MSMQ Queue?

You can read the Performance Counter value for the queue directly from .NET: using System.Diagnostics; // … var queueCounter = new PerformanceCounter( “MSMQ Queue”, “Messages in Queue”, @”machinename\private$\testqueue2″); Console.WriteLine( “Queue contains {0} messages”, queueCounter.NextValue().ToString());

Access to Message Queuing system is denied

I ran into the same issue trying to write to the MSMQ through ASP.NET (Windows 7). I added “Receive Message” “Peek Message” and “Send Message” permissions and it works correctly now. If you’re running this through ASP.NET, then you’re probably under the IIS_IUSRS account.

What is Microsoft Message Queuing (MSMQ)? How does it work?

With all due respect to @Juan’s answer, both are ways of exchanging data between two disconnected processes, i.e. interprocess communication channels (IPC). Message queues are asynchronous, while webservices are synchronous. They use different protocols and back-end services to do this so they are completely different in implementation, but similar in purpose. You would want to … Read more

Comparison between RabbitMQ and MSMQ

I wrote a blog post a while back comparing MSMQ and RabbitMQ (among others): http://mikehadlow.blogspot.co.uk/2011/04/message-queue-shootout.html RabbitMQ gave slightly better performance than MSMQ, but both were comprehensively out performed by ZeroMQ. If performance is your main criteria, you should definitely look at ZeroMQ. It’s worth noting that RabbitMQ and MSMQ are very different beasts. MSMQ is … Read more

nServiceBus vs Mass Transit vs Rhino Service Bus vs other?

I’d recommend staying away from hand-rolled solutions as there is a bunch of somewhat difficult stuff that needs to be gotten just right – like how transactions are handled, how exceptions cause rollbacks, how to stop rolling back endlessly (poison messages), how to integrate with long-running workflows so that the state management boundaries line up, … Read more

The bare minimum needed to write a MSMQ sample application

//From Windows Service, use this code MessageQueue messageQueue = null; if (MessageQueue.Exists(@”.\Private$\SomeTestName”)) { messageQueue = new MessageQueue(@”.\Private$\SomeTestName”); messageQueue.Label = “Testing Queue”; } else { // Create the Queue MessageQueue.Create(@”.\Private$\SomeTestName”); messageQueue = new MessageQueue(@”.\Private$\SomeTestName”); messageQueue.Label = “Newly Created Queue”; } messageQueue.Send(“First ever Message is sent to MSMQ”, “Title”); //From Windows application MessageQueue messageQueue = new MessageQueue(@”.\Private$\SomeTestName”); … Read more

Is it possible to enable MSMQ from PowerShell on Windows 8?

Sure, when using the GUI, you would use the ‘Windows Features’ dialog through the control panel: To do the same thing in PowerShell you can use the Enable-WindowsOptionalFeature cmdlet. You need to know the internal feature names, to get these, run: Get-WindowsOptionalFeature –Online | ? FeatureName -match “msmq” | select FeatureName you get something like … Read more

How can I see MSMQ in local Computer Management interface?

As suggested by John Breakwell’s comment, MSMQ was not installed on my local machine. I followed these steps to enable management of a remote MSMQ application from my local machine Install MSMQ At a command prompt, run the command OptionalFeatures to open the ‘Windows Features’ dialog. In the feature tree of the dialog, Check the … Read more