Sun GlassFish Message Queue 4.4 Developer's Guide for JMX Clients

Connection Services

This section describes the MBeans used for managing connection services:

The following subsections describe each of these MBeans in detail.

Service Configuration

The service configuration MBean is used for configuring a connection service. There is one such MBean for each service.

Object Name

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

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

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

Table 3–7 Connection Service Names for Service Configuration 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 configuration MBean has the attributes shown in Table 3–8. The names of these attributes are defined as static constants in the utility class ServiceAttributes.

Table 3–8 Service Configuration Attributes

Name 

Type 

Settable? 

Description 

Name

String

No 

Service name 

See Table 3–7 for possible values.

Port

Integer

Yes 

Port number (jms, ssljms, admin, and ssladmin services only)

A value of 0 specifies that the port is to be dynamically allocated by the Port Mapper; to learn the actual port currently used by the service, use the Port attribute of the service monitor MBean.

MinThreads

Integer

Yes 

Minimum number of threads assigned to service 

Must be greater than 0.

MaxThreads

Integer

Yes 

Maximum number of threads assigned to service 

Must be greater than or equal to MinThreads.

ThreadPoolModel

String

No 

Threading model for thread pool management:  

    dedicated: Two dedicated threads per connection, one for incoming and one for outgoing messages


    shared: Connections processed by shared thread when sending or receiving messages (jms and admin services only)


Operations

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

Table 3–9 Service Configuration Operations

Name 

Parameters 

Result Type 

Description 

pause

None 

None 

Pause service (jms, ssljms, httpjms, and httpsjms services only)

resume

None 

None 

Resume service (jms, ssljms, httpjms, and httpsjms services only)

Notification

The service configuration MBean supports the notification shown in Table 3–10.

Table 3–10 Service Configuration Notification

Name 

Description 

jmx.attribute.change

Attribute value changed 

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.

Service Manager Configuration

Each broker has a single service manager configuration MBean, used for managing all of the broker's service configuration MBeans.

Object Name

The service manager configuration MBean has the following object name:

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

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

Attributes

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

Table 3–17 Service Manager Configuration Attributes

Name 

Type 

Settable? 

Description 

MinThreads

Integer

No 

Total minimum number of threads for all active services 

MaxThreads

Integer

No 

Total maximum number of threads for all active services 

Operations

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

Table 3–18 Service Manager Configuration Operations

Name 

Parameters 

Result Type 

Description 

getServices

None 

ObjectName[]

Object names of service configuration MBeans for all services 

pause

None 

None 

Pause all services except admin and ssladmin

resume

None 

None 

Resume all services 

Service Manager Monitor

Each broker has a single service manager monitor MBean, used for managing all of the broker's service monitor MBeans.

Object Name

The service manager monitor MBean has the following object name:

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

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

Attributes

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

Table 3–19 Service Manager Monitor Attributes

Name 

Type 

Settable? 

Description 

NumServices

Integer

No 

Number of connection services 

NumActiveThreads

Integer

No 

Total current number of threads actively handling connections for all services 

NumMsgsIn

Long

No 

Total cumulative number of messages received by all services since broker started 

NumMsgsOut

Long

No 

Total cumulative number of messages sent by all services since broker started 

MsgBytesIn

Long

No 

Total cumulative size in bytes of messages received by all services since broker started 

MsgBytesOut

Long

No 

Total cumulative size in bytes of messages sent by all services since broker started 

NumPktsIn

Long

No 

Total cumulative number of packets received by all services since broker started 

NumPktsOut

Long

No 

Total cumulative number of packets sent by all services since broker started 

PktBytesIn

Long

No 

Total cumulative size in bytes of packets received by all services since broker started 

PktBytesOut

Long

No 

Total cumulative size in bytes of packets sent by all services since broker started 

Operation

The service manager monitor MBean supports the operation shown in Table 3–20. The name of this operation is defined as a static constant in the utility class ServiceOperations.

Table 3–20 Service Manager Monitor Operation

Name 

Parameters 

Result Type 

Description 

getServices

None 

ObjectName[]

Object names of all service monitor MBeans 

Notifications

The service manager monitor MBean supports the notifications shown in Table 3–21. These notifications are instances of the Message Queue JMX class ServiceNotification, and their names are defined as static constants in that class.

Table 3–21 Service Manager Monitor Notifications

Name 

Utility Constant 

Description 

mq.service.pause

ServiceNotification.SERVICE_PAUSE

Service paused 

mq.service.resume

ServiceNotification.SERVICE_RESUME

Service resumed 

Table 3–22 shows the method defined in class ServiceNotification for obtaining details about a service manager monitor notification.

Table 3–22 Data Retrieval Method for Service Manager Monitor Notifications

Method 

Result Type 

Description 

getServiceName

String

Service name 

See Table 3–11 for possible values.