Sun Java System Message Queue 3.7 UR1 Developer's Guide for Java Clients

Creating a Metrics-Monitoring Client

You create a metrics monitoring client in the same way that you would write any JMS client, except that the client must subscribe to one or more special metrics message topic and must be ready to receive and process messages of a specific type and format.

No hierarchical naming scheme is implied in the metrics-message names. You can’t use a wildcard character (*) to identify multiple destination names.

A client that monitors broker metrics must perform the following basic tasks:

ProcedureTo Monitor Broker Metrics

  1. Create a TopicConnectionFactory object.

  2. Create a TopicConnection to the Message Queue service.

  3. Create a TopicSession.

  4. Create a metrics Topic destination object.

  5. Create a TopicSubscriber.


  7. Process metrics messages that are received.




    MapMessage mapMsg;
    * mapMsg is the metrics message received
    String type = mapMsg.getStringProperty("type");
    long timestamp = mapMsg.getLongProperty("timestamp");


    long value1 = mapMsg.getLong("numMsgsIn");
    long value2 = mapMsg.getLong("numMsgsOut");
    int value3 = mapMsg.getInt("diskUtilizationRatio");