locked
Monitoring MSMQ connection health in C# RRS feed

  • Question

  •  

    I've written a service in C# for a customer that pulls processing, data flow, and health metrics from the serrvers in their system and provides them to a customer-developed organization-wide monitoring facility. One of the metrics I monitor is MSMQ connections from an external facility's machines to a single machine at our lcoation. Using perf counter categories, I can tell how many of the expected connections are actually there, but I need a little more. When monitoring message queueing manually using the 'Computer Management' mmc, I can see the connections' status as well; usually reporting 'connected', but sometimes, 'waiting to connect' or 'inactive'. Can anyone point me to where I would get that information programatically?

     

    Thanks in advance.

    Wednesday, November 7, 2007 9:46 AM

Answers

  •  

    I'm not sure how much we can help here (this being just a transactions related forum) but seeing as how MSMQ does not have a forum of their own, I tried to ask around to see if anyone knew anything about this.  I got one response:

     

    "Here is how you can accomplish this using the MSMQ COM API (not sure if these have an equivalent in System.Messaging but it should be trivial to generate a .NET wrapper):

     1. Use MSMQApplication.ActiveQueues to get the list of active queues (which includes outgoing queues)

     2. Filter the list based on the target machine

     3. Use the MSMQManagement.Init for each queue to get an MSMQOutgoingQueueManagement object.

     4. Get the queue state through MSMQOutgoingQueueManagement.State

     

    Hope this helps.."

    Thursday, November 8, 2007 11:31 PM
    Moderator
  • Thanks Jesse - I'll give that a try. Yup, first time poster put this in the wrong forum. I reposted in C# general since, as you pointed out, MSMQ has no forum of its own.

     

    Friday, November 9, 2007 9:37 AM

All replies

  •  

    I'm not sure how much we can help here (this being just a transactions related forum) but seeing as how MSMQ does not have a forum of their own, I tried to ask around to see if anyone knew anything about this.  I got one response:

     

    "Here is how you can accomplish this using the MSMQ COM API (not sure if these have an equivalent in System.Messaging but it should be trivial to generate a .NET wrapper):

     1. Use MSMQApplication.ActiveQueues to get the list of active queues (which includes outgoing queues)

     2. Filter the list based on the target machine

     3. Use the MSMQManagement.Init for each queue to get an MSMQOutgoingQueueManagement object.

     4. Get the queue state through MSMQOutgoingQueueManagement.State

     

    Hope this helps.."

    Thursday, November 8, 2007 11:31 PM
    Moderator
  • Thanks Jesse - I'll give that a try. Yup, first time poster put this in the wrong forum. I reposted in C# general since, as you pointed out, MSMQ has no forum of its own.

     

    Friday, November 9, 2007 9:37 AM
  •  

    MSMQ is looking to open an MSDN Forum in the coming months.

    Currently MSMQ is well supported through the Microsoft newsgroups:

     

    http://blogs.msdn.com/johnbreakwell/archive/2007/03/18/quick-plug-for-the-newsgroups.aspx

     

    Cheers

    John Breakwell (MSFT)

    Saturday, February 9, 2008 12:50 AM