## UMS Broker Monitoring service: XML output specification

The UMS Broker Monitoring services getBrokerInfo is a service which returns XML containing MQ Broker monitoring data. The content of this XML depends on the query string that is used.

This is a description of the XML that is returned by this service.

### XML elements

The XML document returned by a getBrokerInfo query has the following general structure:

    <BrokerInfo>
        <Header>
            <GeneratedDate>
                <Milliseconds>2347657265323342</Milliseconds>
                <DateString>Monday, November 10, 2008 4:25:24 PM PST</DateString>
            </GeneratedDate>
            <RequestProperties cmd="getDestinations"/>
            <Broker>
                <InstanceName>imqbroker</InstanceName>
                <Port>7676</Port>
                <Version>4.5.1</Version>
                <Host>myHost</Host>
                <VarHome>/var/imq</VarHome>
                ...
            </Broker>
        <Header>
        <Body>
        ...
        </Body>
    </BrokerInfo>

There are two main elements; <Header> and <Body>.

The <Header> element is common to all queries and should return the same information for each request apart for <GeneratedDate>.

The <Body> element will depend on the particular query being performed

### Header elements

XML Element | Description
--- | ---
Header | Header element of UMS BrokerInfo reply XML
GeneratedDate | Date when this XML reply was generated.
Milliseconds | Milliseconds since Jan 1, 1970
DateString | Human readable date string.
RequestProperties | Request properties as submitted via the query string. This is a list of key=value pairs.
Broker | High level details on the broker being queried.

### Body Elements

The information returned in the Body element depends on the type of query being performed, as defined by the cmd request parameter.

Currently the only type of query available is cmd=getDestinations

#### Body elements for cmd=getDestinations

The Body element has the following structure:

Query String | service=getBrokerInfo&cmd=getDestinations
Description | List all destinations and show all monitoring/runtime information of those destinations.
XML returned |
    <Destinations>
       <Destination>
          <AvgNumActiveConsumers>0</AvgNumActiveConsumers>
          <AvgNumBackupConsumers>0</AvgNumBackupConsumers>
          <AvgNumConsumers>0</AvgNumConsumers>
          <AvgNumMsgs>0</AvgNumMsgs>
          <AvgTotalMsgBytes>0</AvgTotalMsgBytes>
          <ConnectionID>0</ConnectionID>
          <CreatedByAdmin>false</CreatedByAdmin>
          <DiskReserved>0</DiskReserved>
          <Name>mq.sys.dmq</Name>
          ...
          <Type>q</Type>
          ...
          <ConsumerIDs/>
          ...
       </Destination>
       <Destination>>
          <AvgNumActiveConsumers>0</AvgNumActiveConsumers>
          <AvgNumBackupConsumers>0</AvgNumBackupConsumers>
          <AvgNumConsumers>0</AvgNumConsumers>
          <AvgNumMsgs>0</AvgNumMsgs>
          <AvgTotalMsgBytes>0</AvgTotalMsgBytes>
          <ConnectionID>0</ConnectionID>
          <CreatedByAdmin>false</CreatedByAdmin>
          <DiskReserved>0</DiskReserved>
          <Name>SimpleTopic</Name>
          ...
          <Type>t</Type>
          ...
          <ConsumerIDs>
             <ConsumerID>129230792242097664</ConsumerID>
             <ConsumerID>129230792243460352</ConsumerID>
          </ConsumerIDs>
          ...
          </Destination>
          ...
    </Destinations>
Notes | The child elements that are returned within the <Destination> elements come directly from the corresponding JMX MBean: DestinationMonitor in this case. Attributes There is a one-to-one mapping between the MBean attribute name and the XML element name e.g. The getCreatedByAdmin() attribute corresponds to the <CreatedByAdmin> element. Operations Only operations that are read-only are considered. This means operations that do not have any impact on the destination, which is most of them. Only operations that do not require any parameters are considered The XML element name is constructed by removing the prefix get from the operation name. For example: the value returned by the getConsumerIDs() operation will be listed under the <ConsumerIDs> XML element If the data returned is an array, a sub-element is created for each array element. The name used for this sub-element is the singular of its parent. For example, the <ConsumerIDs> XML element will contain an element named <ConsumerID> for each consumer of this destination.

The dest-elements attribute can be appended to the query to specify which particular elements should be returned:

Query String | service=getBrokerInfo&cmd=getDestinations &dest-elements=Name,Type,NumMsgs
Description | List all destinations and show the specified monitoring/runtime information of those destinations
XML returned |
    <Destinations>
       <Destination>
          <Name>mq.sys.dmq</Name>
          <NumMsgs>300</NumMsgs>
          <Type>q</Type>
       </Destination>

       <Destination>
          <Name>SimpleTopic</Name>
          <NumMsgs>300</NumMsgs>
          <Type>t</Type>
       </Destination>
       ...
    </Destinations>
Notes | The values listed after the dest-elements parameter are comma-separated and designate the XML elements (for both attributes and operations) that are to be returned.