A question about monitoring the queues - Forum - Technology Partner - Progress Community

A question about monitoring the queues

 Forum

A question about monitoring the queues

  • I know that we are using SonicMQ 7.6 (we aren't using the Event Monitor: we don't a license for it) and I also know that we haven't had the opportunity to upgrade to 8.0 (even if we have the license and I heard it has the Event Monitor).

    Is there a way I can use to find out if a queue is ever used? We have a large number of (distributed) teams and I was asked to "prune" the unused queues (asking each team will take a long time due to their busy schedules).

    Thanks,

    Aziz

  • You could try using the application.alert.queue.messages.Count notification, see the NotificationReporter.java sample in \MQx.x\samples\Management\runtimeAPI\javaProxy.

  • Thanks, The problem with this approach is that it will always return 0 if the messages are flowing to the consumer. Is there any other notification(s) I can use?

    I did find this snippet (below) which kind of made me have more questions than answers.

    filter = new ExpressionBasedNotificationFilter();

    filter.setTypeExpression("application\\.session\\.(S|Uns)ubscribe");

    filter.setAttributeExpression("TopicName", "App1Topic|App2Topics\\..*");

    filter.setAttributeExpression("UserName", "App[12]User");

      1. "application\\.session\\.(S|Uns)ubscribe": where can I find the set of possible expressions? Or at least how, as the API user, I would have discovered the right structure for each option (for example what else is available in addition to subscribe and unsubscrbe?)
      2. Can you provide me with an example showing how I can this specific class to monitor a queue say "SampleQ1"?

    BTW, just to prove my point, I wrote a toy program to continuously produce and consume messages to SampleQ1 and when I run ShowQueues:

    I get:

    SampleQ4, 0

    SonicMQ.routingQueue, 0

    SampleQ3, 0

    SampleQ2, 0

    SampleQ1, 0

    SonicMQ.deadMessage, 0

    Thanks

  • The queue.messages.MaxDepth metric might be helpful here.  You can browse the available metrics and notifications in the Sonic Management Console as well as graphing metric values.

    You could also take a look at the MgmtCLI sample.  The following commands show the MaxDepth metric for SampleQ1 on the management broker in a default SonicMQ install:

      cd \samples\Management\runtimeAPI\javaJMX

      ..\..\..\Mgmt.bat MgmtCLI localhost:2506 Administrator Administrator

        cc Domain1.DomainManager:ID=MgmtBroker

        enable queue.messages.MaxDepth.SampleQ1

        capture queue.messages.MaxDepth.SampleQ1

    You can also enable and capture the MaxDepth metric for all queues at once:

        enable queue.messages.MaxDepth.*

        capture queue.messages.MaxDepth.*

    Note that the 'enable' only has to be done once, you can then repeat the 'capture' as needed.  This is true even if you close the MgmtCLI sample and launch it again since any metrics that were enabled on the broker in the last session will stay enabled.  Use "show enabled" to check what metrics are currently enabled.  Once you're finished with the metrics you can disable them.

  • Excellent!

    Thanks

  • Excellent support.

    Thank you guys.