Sun Java System Message Queue 4.3 Administration Guide

Managing Connections

The Command utility’s list cxn and query cxn subcommands display information about individual connections. The subcommand imqcmd list cxn lists all connections for a specified connection service:

   imqcmd list cxn  [-svn serviceName]
                    [-b hostName:portNumber]

If no service name is specified, all connections are listed. For example, the following command lists all connections on the default broker (host localhost at port 7676):

   imqcmd list cxn  -u admin

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

Example 6–4 Broker Connections Listing

Listing all the connections on the broker specified by:
Host                   Primary Port
localhost              7676

Connection ID         User    Service   Producers  Consumers    Host
1964412264455443200   guest   jms       0          1  
1964412264493829311   admin   admin     1          1  

Successfully listed connections.

To display detailed information about a single connection, obtain the connection identifier from imqcmd list cxn and pass it to the imqcmd query cxn subcommand:

   imqcmd query cxn   -n connectionID
                     [-b hostName:portNumber]

For example, the command

   imqcmd query cxn  -n 421085509902214374  -u admin

produces output like that shown in Example 6–5.

Example 6–5 Connection Information Listing

Connection ID      421085509902214374
User               guest
Service            jms
Producers          0
Consumers          1
Host               111.22.333.444
Port               60953
Client ID          
Client Platform    

The imqcmd destroy cxn subcommand destroys a connection:

   imqcmd destroy cxn   -n connectionID
                     [-b hostName:portNumber]

For example, the command

   imqcmd destroy cxn  -n 421085509902214374  -u admin

destroys the connection shown in Example 6–5.