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

Message Brokers

This section describes the MBeans used for managing message brokers:

The following subsections describe each of these MBeans in detail.

Broker Configuration

The broker configuration MBean is used for configuring a message broker. There is one such MBean for each broker.

Object Name

The broker configuration MBean has the following object name:

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

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

Attributes

The broker configuration MBean has the attributes shown in Table 2–1. The names of these attributes are defined as static constants in the utility class BrokerAttributes.

Table 2–1 Broker Configuration Attributes

Name 

Type 

Settable? 

Description 

BrokerID

String

No 

Broker identifier

Appended to database table names to make them unique when more than one broker instance is using the same database as a persistent data store. If a database is not used as the persistent data store, the value of this attribute is null.

Version

String

No 

Broker version 

InstanceName

String

No 

Broker instance name 

Example: imqbroker

Port

Integer

Yes 

Port number of Port Mapper 

Operations

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

Table 2–2 Broker Configuration Operations

Name 

Parameters 

Return Type 

Description 

shutdown

time (Long)

None 

Shut down broker 

The time parameter specifies the interval, in seconds, before the broker actually shuts down; for immediate shutdown, specify 0 or null.

shutdown

None 

None 

Shut down broker immediately 

Equivalent to shutdown(new Long(0)).

restart

None 

None 

Restart broker 

quiesce

None 

None 

Quiesce broker 

The broker will refuse any new connections; existing connections will continue to be served.  

unquiesce

None 

None 

Unquiesce broker 

The broker will again accept new connections.  

resetMetrics

None 

None 

Reset metrics 

Resets to zero all metrics in monitor MBeans that track cumulative, peak, or average counts. The following attributes are affected:  

     

Service monitor

  • NumConnectionsOpened

  • NumConnectionsRejected

  • NumMsgsIn

  • NumMsgsOut

  • MsgBytesIn

  • MsgBytesOut

  • NumPktsIn

  • NumPktsOut

  • PktBytesIn

  • PktBytesOut

     

Service manager monitor

  • NumMsgsIn

  • NumMsgsOut

  • MsgBytesIn

  • MsgBytesOut

  • NumPktsIn

  • NumPktsOut

  • PktBytesIn

  • PktBytesOut

     

Connection manager monitor

  • NumConnectionsOpened

  • NumConnectionsRejected

     

Destination monitor

  • PeakNumConsumers

  • AvgNumConsumers

  • PeakNumActiveConsumers

  • AvgNumActiveConsumers

  • PeakNumBackupConsumers

  • AvgNumBackupConsumers

  • PeakNumMsgs

  • AvgNumMsgs

  • NumMsgsIn

  • NumMsgsOut

  • MsgBytesIn

  • MsgBytesOut

  • PeakMsgBytes

  • PeakTotalMsgBytes

  • AvgTotalMsgBytes

     

Transaction manager monitor

  • NumTransactionsCommitted

  • NumTransactionsRollback

Notification

The broker configuration MBean supports the notification shown in Table 2–3.

Table 2–3 Broker Configuration Notification

Name 

Description 

jmx.attribute.change

Attribute value changed 

Broker Monitor

The broker monitor MBean is used for monitoring a message broker. There is one such MBean for each broker.

Object Name

The broker monitor MBean has the following object name:

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

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

Attributes

The broker monitor MBean has the attributes shown in Table 2–4. The names of these attributes are defined as static constants in the utility class BrokerAttributes.

Table 2–4 Broker Monitor Attributes

Name 

Type 

Settable? 

Description 

BrokerID

String

No 

Broker identifier

Appended to database table names to make them unique when more than one broker instance is using the same database as a persistent data store. If a database is not used as the persistent data store, the value of this attribute is null.

Version

String

No 

Broker version 

InstanceName

String

No 

Broker instance name 

Port

Integer

No 

Port number of Port Mapper 

Embedded

Boolean

No 

Is broker embedded (started from within another process)? 

Notifications

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

Table 2–5 Broker Monitor Notifications

Name 

Utility Constant 

Description 

mq.broker.shutdown.start

BrokerNotification.BROKER_SHUTDOWN_START

Broker has begun shutting down 

mq.broker.quiesce.start

BrokerNotification.BROKER_QUIESCE_START

Broker has begun quiescing 

mq.broker.quiesce.complete

BrokerNotification.BROKER_QUIESCE_COMPLETE

Broker has finished quiescing 

mq.cluster.broker.join

ClusterNotification.CLUSTER_BROKER_JOIN

Broker has joined a cluster 

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

Table 2–6 Data Retrieval Methods for Broker Monitor Notifications

Method 

Return Type 

Description 

getBrokerID

String

Broker identifier

getBrokerAddress

String

Broker address, in the form hostName:portNumber

Example: host1:3000