Sun Java System Message Queue 4.0 Developer's Guide for JMX Clients

Broker Clusters

This section describes the MBeans used for managing broker clusters:

The following subsections describe each of these MBeans in detail.

Cluster Configuration

The cluster configuration MBean is used for configuring a broker's cluster-related properties. There is one such MBean for each broker.

Object Name

The cluster configuration MBean has the following object name:

com.sun.messaging.jms.server:type=Cluster,subtype=Config

A string representing this object name is defined as a static constant CLUSTER_CONFIG_MBEAN_NAME in the utility class MQObjectName.

Attributes

The cluster configuration MBean has the attributes shown in Table 2–74. The names of these attributes are defined as static constants in the utility class ClusterAttributes.

Table 2–74 Cluster Configuration Attributes

Name 

Type 

Settable? 

Description 

ConfigFileURL

String

Yes 

URL of cluster configuration file

LocalBrokerInfo

CompositeData

No 

Descriptive information about local broker 

The value returned is a JMX CompositeData object describing the broker; see Table 2–76 for lookup key used with this object.

MasterBrokerInfo

CompositeData

No 

Descriptive information about master broker 

The value returned is a JMX CompositeData object describing the master broker; see Table 2–76 for lookup key used with this object.

Operations

The cluster configuration MBean supports the operations shown in Table 2–75. The names of these operations are defined as static constants in the utility class ClusterOperations.

Table 2–75 Cluster Configuration Operations

Name 

Parameters 

Return Type 

Description 

getBrokerAddresses

None 

String[]

Addresses of brokers in cluster 

Each address specifies the host name and Port Mapper port number of a broker in the cluster, in the form hostName:portNumber.

Example: host1:3000.

The list includes all brokers specified by the broker property imq.cluster.brokerlist.

getBrokerInfoByAddress

brokerAddress (String)

CompositeData

Descriptive information about broker 

The desired broker is designated by its host name and Port Mapper port number (brokerAddress), in the form hostName:portNumber. The value returned is a JMX CompositeData object describing the broker; see Table 2–76 for lookup keys used with this object.

getBrokerInfo

None 

CompositeData[]

Descriptive information about all brokers in cluster 

The value returned is an array of JMX CompositeData objects describing the brokers; see Table 2–76 for lookup keys used with these objects.

The array includes all brokers specified by the broker property imq.cluster.brokerlist.

reload

None 

None 

Reload cluster configuration file 

The LocalBrokerInfo and MasterBrokerInfo attributes and the getBrokerInfoByAddress and getBrokerInfo operations return objects implementing the JMX interface CompositeData, which maps lookup keys to associated data values. The key shown in Table 2–76 is defined as a static constant in the utility class BrokerClusterInfo for use with these objects.

Table 2–76 Lookup Key for Cluster Configuration Information

Key 

Value Type 

Description 

Address

String

Broker address, in the form hostName:portNumber

Example: host1:3000

Notification

The cluster configuration MBean supports the notification shown in Table 2–77.

Table 2–77 Cluster Configuration Notification

Name 

Description 

jmx.attribute.change

Attribute value changed 

Cluster Monitor

The cluster monitor MBean is used for monitoring the brokers in a cluster. There is one such MBean for each broker.

Object Name

The cluster monitor MBean has the following object name:

com.sun.messaging.jms.server:type=Cluster,subtype=Monitor

A string representing this object name is defined as a static constant CLUSTER_MONITOR_MBEAN_NAME in the utility class MQObjectName.

Attributes

The cluster monitor MBean has the attributes shown in Table 2–78. The names of these attributes are defined as static constants in the utility class ClusterAttributes.

Table 2–78 Cluster Monitor Attributes

Name 

Type 

Settable? 

Description 

ConfigFileURL

String

Yes 

URL of cluster configuration file

LocalBrokerInfo

CompositeData

No 

Descriptive information about local broker 

The value returned is a JMX CompositeData object describing the broker; see Table 2–80 for lookup keys used with this object.

MasterBrokerInfo

CompositeData

No 

Descriptive information about master broker 

The value returned is a JMX CompositeData object describing the master broker; see Table 2–80 for lookup keys used with this object.

Operations

The cluster monitor MBean supports the operations shown in Table 2–79. The names of these operations are defined as static constants in the utility class ClusterOperations.

Table 2–79 Cluster Monitor Operations

Name 

Parameters 

Return Type 

Description 

getBrokerAddresses

None 

String[]

Addresses of brokers in cluster 

Each address specifies the host name and Port Mapper port number of a broker in the cluster, in the form hostName:portNumber.

Example: host1:3000.

The list includes all brokers specified by the broker property imq.cluster.brokerlist.

getBrokerInfoByAddress

brokerAddress (String)

CompositeData

Descriptive information about broker 

The desired broker is designated by its host name and Port Mapper port number (brokerAddress), in the form hostName:portNumber. The value returned is a JMX CompositeData object describing the broker; seeTable 2–80 for lookup keys used with this object.

getBrokerInfo

None 

CompositeData[]

Descriptive information about all brokers in cluster 

The value returned is an array of JMX CompositeData objects describing the brokers; see Table 2–80 for lookup keys used with these objects.

The array includes all brokers specified by the broker property imq.cluster.brokerlist.

The LocalBrokerInfo and MasterBrokerInfo attributes and the getBrokerInfoByAddress and getBrokerInfo operations return objects implementing the JMX interface CompositeData, which maps lookup keys to associated data values. The keys shown in Table 2–80 are defined as static constants in the utility class BrokerClusterInfo for use with these objects.

Table 2–80 Lookup Keys for Cluster Monitor Information

Key 

Value Type 

Description 

Address

String

Broker address, in the form hostName:portNumber

Example: host1:3000

State

Integer

Current state of broker 

See Table 2–81 for possible values.

StateLabel

String

String representation of current broker state 

Useful for displaying the state in human-readable form, such as in the Java Monitoring and Management Console (jconsole).

See Table 2–81 for possible values.

Table 2–81 shows the possible values returned for the lookup keys State and StateLabel. These values are defined as static constants in the utility class BrokerState.

Table 2–81 Broker State Values

Value 

Utility Constant 

String Representation 

Meaning 

0

BrokerState.OPERATING

OPERATING

Broker is operating 

4

BrokerState.QUIESCE_STARTED

QUIESCE_STARTED

Broker has begun quiescing 

5

BrokerState.QUIESCE_COMPLETE

QUIESCE_COMPLETE

Broker has finished quiescing 

6

BrokerState.SHUTDOWN_STARTED

SHUTDOWN_STARTED

Broker has begun shutting down 

7

BrokerState.BROKER_DOWN

BROKER_DOWN

Broker is down 

-1

BrokerState.UNKNOWN

UNKNOWN

Broker state unknown 

Notifications

The cluster monitor MBean supports the notifications shown in Table 2–82. These notifications are instances of the Message Queue JMX classes ClusterNotification and BrokerNotification, and their names are defined as static constants in those classes.

Table 2–82 Cluster Monitor Notifications

Name 

Utility Constant 

Description 

mq.cluster.broker.join

ClusterNotification.CLUSTER_BROKER_JOIN

A broker has joined the cluster 

mq.cluster.broker.down

ClusterNotification.CLUSTER_BROKER_DOWN

A broker in the cluster has shut down or crashed 

Table 2–83 shows the methods defined in class ClusterNotification for obtaining details about a cluster monitor notification. See Table 2–6 for the corresponding methods of class BrokerNotification.

Table 2–83 Data Retrieval Methods for Cluster Monitor Notifications

Method 

Return Type 

Description 

getClusterID

String

Cluster identifier

getBrokerID

String

Broker identifier of affected broker

getBrokerAddress

String

Address of affected broker, in the form hostName:portNumber

Example: host1:3000

isMasterBroker

Boolean

Master broker affected?