Sun GlassFish Message Queue 4.4 Administration Guide

Managing Connection Services

Message Queue brokers support connections from both application clients and administrative clients. See Configuring Connection Services for a description of the available connection services. The Command utility provides subcommands that you can use for managing both connection services as a whole and individual services; to apply a subcommand to a particular service, use the -n option to specify one of the names listed in the “Service Name” column of Table 6–1. Subcommands are available for the following connection service management tasks:

Pausing and Resuming a Connection Service

Pausing a connection service has the following effects:

The admin connection service can never be paused; to pause and resume any other service, use the subcommands imqcmd pause svc and imqcmd resume svc. The syntax of the imqcmd pause svc subcommand is as follows:

   imqcmd pause svc   -n serviceName
                     [-b hostName:portNumber]

For example, the following command pauses the httpjms service running on the default broker (host localhost at port 7676):

   imqcmd pause svc  -n httpjms  -u admin

The imqcmd resume svc subcommand resumes operation of a connection service following a pause:

   imqcmd resume svc   -n serviceName
                      [-b hostName:portNumber]

Updating Connection Service Properties

You can use the imqcmd update svc subcommand to change the value of one or more of the service properties listed in Table 6–2. See Connection Properties for a description of these properties.

Table 6–2 Connection Service Properties Updated by Command Utility

Property 

Description 

port

Port assigned to the service to be updated (does not apply to httpjms or httpsjms)

A value of 0 means the port is dynamically allocated by the Port Mapper.

minThreads

Minimum number of threads assigned to the service

maxThreads

Maximum number of threads assigned to the service 

The imqcmd update svc subcommand has the following syntax:

   imqcmd update svc   -n serviceName
                      [-b hostName:portNumber]
                       -o property1=value1  [[-o property2=value2]…]

For example, the following command changes the minimum number of threads assigned to the jms connection service on the default broker (host localhost at port 7676) to 20:

   imqcmd update svc  -o minThreads=20  -u admin

Viewing Connection Service Information

To list the connection services available on a broker, use the imqcmd list svc subcommand:

   imqcmd list svc  [-b hostName:portNumber]

For example, the following command lists all services on the default broker (host localhost at port 7676):

   imqcmd list svc  -u admin

Example 6–1 shows an example of the resulting output.


Example 6–1 Connection Services Listing


------------------------------------------------
Service Name    Port Number        Service State
------------------------------------------------
admin           41844 (dynamic)    RUNNING
httpjms         -                  UNKNOWN
httpsjms        -                  UNKNOWN
jms             41843 (dynamic)    RUNNING
ssladmin        dynamic            UNKNOWN
ssljms          dynamic            UNKNOWN


The imqcmd query svc subcommand displays information about a single connection service:

   imqcmd query svc   -n serviceName
                     [-b hostName:portNumber]

For example, the following command displays information about the jms connection service on the default broker (host localhost at port 7676):

imqcmd query svc  -n jms  -u admin

Example 6–2 shows an example of the resulting output.


Example 6–2 Connection Service Information Listing


Service Name                           jms
Service State                          RUNNING
Port Number                            60920 (dynamic)
                                     
Current Number of Allocated Threads    0
Current Number of Connections          0
                                     
Min Number of Threads                  10
Max Number of Threads                  1000


To display metrics information about a connection service, use the imqcmd metrics svc subcommand:

   imqcmd metrics svc   -n serviceName
                       [-b hostName:portNumber]
                       [-m metricType]
                       [-int interval]
                       [-msp numSamples]

The -m option specifies the type of metric information to display:

The -int and -msp options specify, respectively, the interval (in seconds) at which to display the metrics and the number of samples to display in the output. The default values are 5 seconds and an unlimited number of samples.

For example, the following command displays cumulative totals for messages and packets handled by the default broker (host localhost at port 7676) by way of the jms connection service:

   imqcmd metrics svc  -n jms  -m ttl  -u admin

Example 6–3 shows an example of the resulting output.


Example 6–3 Connection Service Metrics Listing


-------------------------------------------------
  Msgs      Msg Bytes      Pkts      Pkt Bytes   
In   Out    In     Out   In   Out    In     Out  
-------------------------------------------------
164  100  120704  73600  282  383  135967  102127
657  100  483552  73600  775  876  498815  149948


For a more detailed description of the use of the Command utility to report connection service metrics, see Connection Service Metrics.