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

Service Monitor

The service monitor MBean is used for monitoring a connection service. There is one such MBean for each service.

Object Name

The service monitor MBean has an object name of the following form:

com.sun.messaging.jms.server:type=Service,subtype=Monitor,name=serviceName

where serviceName is the name of the connection service (see Table 3–11). The utility class MQObjectName provides a static method, createServiceMonitor, for constructing object names of this form.

Table 3–11 Connection Service Names for Service Monitor MBeans

Service Name 

Service Type 

Protocol Type 

jms

Normal 

TCP

ssljms

Normal 

TLS (SSL-based security)

httpjms

Normal 

HTTP

httpsjms

Normal 

HTTPS (SSL-based security)

admin

Admin 

TCP

ssladmin

Admin 

TLS (SSL-based security)

Attributes

The service monitor MBean has the attributes shown in Table 3–12. The names of these attributes are defined as static constants in the utility class ServiceAttributes.

Table 3–12 Service Monitor Attributes

Name 

Type 

Settable? 

Description 

Name

String

No 

Service name 

See Table 3–11 for possible values.

Port

Integer

No 

Port number currently used by service 

State

Integer

No 

Current state 

See Table 3–13 for possible values.

StateLabel

String

No 

String representation of current state:  

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

See Table 3–13 for possible values.

NumConnections

Integer

No 

Current number of connections 

NumConnectionsOpened

Long

No 

Cumulative number of connections opened since broker started 

NumConnectionsRejected

Long

No 

Cumulative number of connections rejected since broker started 

NumActiveThreads

Integer

No 

Current number of threads actively handling connections 

NumProducers

Integer

No 

Current number of message producers 

NumConsumers

Integer

No 

Current number of message consumers 

NumMsgsIn

Long

No 

Cumulative number of messages received since broker started 

NumMsgsOut

Long

No 

Cumulative number of messages sent since broker started 

MsgBytesIn

Long

No 

Cumulative size in bytes of messages received since broker started 

MsgBytesOut

Long

No 

Cumulative size in bytes of messages sent since broker started 

NumPktsIn

Long

No 

Cumulative number of packets received since broker started 

NumPktsOut

Long

No 

Cumulative number of packets sent since broker started 

PktBytesIn

Long

No 

Cumulative size in bytes of packets received since broker started 

PktBytesOut

Long

No 

Cumulative size in bytes of packets sent since broker started 

Table 3–13 shows the possible values for the State and StateLabel attributes. These values are defined as static constants in the utility class ServiceState.

Table 3–13 Connection Service State Values

Value 

Utility Constant 

String Representation 

Meaning 

0

ServiceState.RUNNING

RUNNING

Service running 

1

ServiceState.PAUSED

PAUSED

Service paused 

2

ServiceState.QUIESCED

QUIESCED

Service quiesced 

-1

ServiceState.UNKNOWN

UNKNOWN

Service state unknown 

Operations

The service monitor MBean supports the operations shown in Table 3–14. The names of these operations are defined as static constants in the utility class ServiceOperations.

Table 3–14 Service Monitor Operations

Name 

Parameters 

Result Type 

Description 

getConnections

None 

ObjectName[]

Object names of connection monitor MBeans for all current connections 

getProducerIDs

None 

String[]

Producer identifiers of all current message producers

getConsumerIDs

None 

String[]

Consumer identifiers of all current message consumers 

Notifications

The service monitor MBean supports the notifications shown in Table 3–15. These notifications are instances of the Message Queue JMX classes ServiceNotification and ConnectionNotification, and their names are defined as static constants in those classes.

Table 3–15 Service Monitor Notifications

Name 

Utility Constant 

Description 

mq.service.pause

ServiceNotification.SERVICE_PAUSE

Service paused 

mq.service.resume

ServiceNotification.SERVICE_RESUME

Service resumed 

mq.connection.open

ConnectionNotification.CONNECTION_OPEN

Connection opened 

mq.connection.reject

ConnectionNotification.CONNECTION_REJECT

Connection rejected 

mq.connection.close

ConnectionNotification.CONNECTION_CLOSE

Connection closed 

Table 3–16 shows the method defined in class ServiceNotification for obtaining details about a service monitor notification. See Table 3–31 for the corresponding methods of class ConnectionNotification.

Table 3–16 Data Retrieval Method for Service Monitor Notifications

Method 

Result Type 

Description 

getServiceName

String

Service name 

See Table 3–11 for possible values.