Broker statistics API

The messaging broker provides a REST API which can be used to gather statistics about the broker and the messaging resources.

Overview

The messaging broker statistics can be accessed by sending a GET request to the HTTP or HTTPS port on which the broker application is listening. The URL path must be of the form contextRoot /opsmanager/application/_self?q=stats. For example:

http://localhost:8081/opsmanager/application/_self?q=stats

The GET request must be sent to the HTTP or HTTPS port of the broker application and not the message service listener port.

The response to the request is a map in JSON format similar to the following example:

{
  "monitoredStats" : {
    "brokerStats":{
      "listeners":{
        "MqttLocalListener":{
          "type":"com.ibm.micro.admin.MQTTLocalListener",
          "clients":{
          }
        },
        "MqttTlsListener9091":{
          "type":"com.ibm.micro.admin.MQTTTLSListener",
          "clients":{
            "1208263659970-14-159517058":{
              "protocol":"MQTT",
              "protocolVersion":"4",
              "numberOfInFlightMessages":0,
              "numberOfQueuedMessages":0,
              "numberOfSubscriptions":0,
              "connectionTime":"Tue Apr 15 13:47:40 BST 2008",
              "lastActivityTime":"Tue Apr 15 13:47:44 BST 2008"
            },
            "1208263586505-28-430971312":{
              "protocol":"MQTT",
              "protocolVersion":"4",
              "numberOfInFlightMessages":0,
              "numberOfQueuedMessages":0,
              "numberOfSubscriptions":0,
              "connectionTime":"Tue Apr 15 13:46:27 BST 2008",
              "lastActivityTime":"Tue Apr 15 13:46:27 BST 2008"
            }
          }
        }
      },
      "stats":{
        "bytesSent":12612,
        "bytesReceived":3582,
        "uptime":135,
        "messagesReceived":20,
        "messagesSent":75,
        "version":"2.1.0.2 - cb210-L080409"
      },
      "persistence":{
        "currentObjectStoreSize":3008,
        "persistenceType":2,
        "logSize":3000,
        "maxLogSize":3000,
        "minObjectStoreSize":3000,
        "maxObjectStoreSize":9223372036854775807
      },
      "name":"testBroker1",
      "queues":{
        "queue1":{
          "consumerCount":0,
          "expiryTimeRemaining":2419196585,
          "lifecycle":0,
          "currentDepth":0,
          "maxMessageSize":50,
          "maxQueueDepth":32768
        },
        "storeAndForward:broker2/queue/queue2":{
          "consumerCount":1,
          "expiryTimeRemaining":2419188393,
          "lifecycle":0,
          "currentDepth":0,
          "maxMessageSize":50,
          "maxQueueDepth":32768
        }
      },
      "pipes":{
        "Pbroker2":{
          "isRunning":true,
          "isConnected":true,
          "outboundFlows":{
            "Qqueue2":{
            }
          }
        }
      }
    }
  }
}

The previous example has been reformatted to better illustrate the messaging broker statistics. In reality, the monitoredStats map contains other entries in addition to brokerStats.

The brokerStats map includes the following entries:

name
The name of the messaging broker.
stats
A map containing general statistics and information about the running message broker.
persistence
A map containing information about the persistence policy and message store, including the following:
currentObjectStoreSize
The current size of the message store, in megabytes.
listeners
A map containing an entry for each active message listener. The state of each listener is represented as another map that includes the following:
clients
A map containing an entry for each client currently connected to the message listener.
pipes
A map containing an entry for each defined store-and-forward pipe. The state of each pipe is represented as another map that includes the following:
isRunning
true if the store-and-forward pipe is connected or attempting to connect to the remote broker. false if the store-and-forward pipe is currently quiesced.
isConnected
true if the store-and-forward pipe is connected to the remote broker. false if the connection to the remote broker is not currently established.
queues
A map containing an entry for each messaging queue managed by the broker. The state of each queue is represented as another map that includes the following:
currentDepth
The number of messages on the queue that are awaiting delivery.
maxQueueDepth
The maximum number of messages that the queue can hold.

Version 1.1.26825