View IBM MQ objects in use by MQ Light clients

We can view the different IBM MQ resources in use by MQ Light clients, for example connections and subscriptions.


Connections

When the AMQP service is started new Hconns are created and connected to the queue manager. This pool of Hconns is used when MQ Light clients publish messages. We can view the Hconns by using the DISPLAY CONN command. For example:
DISPLAY CONN(*) TYPE(CONN) WHERE (APPLDESC LK 'WebSphere MQ Advanced Message Queuing Protocol*')
This command also shows any client-specific Hconns. The Hconns that have a blank client ID attribute are the Hconns used in the pool When an MQ Light client connects to an AMQP channel, a new Hconn is connected to the queue manager. This Hconn is used to consume messages asynchronously for the subscriptions that the MQ Light client has created. We can view the Hconn used by a particular MQ Light client using the DISPLAY CONN command. For example:
DISPLAY CONN(*) TYPE(CONN) WHERE (CLIENTID EQ 'recv_abcd1234')


Subscriptions created by clients

When an MQ Light client subscribes to a topic, a new IBM MQ subscription is created. The subscription name includes the following information:

  • The name of the client. If the client joined a shared subscription, the name of the share is used
  • The topic pattern that the client subscribed to
  • A prefix. The prefix is private if the client created a non-shared subscription, or share if the client joined a shared subscription

To view the subscriptions in use by a particular MQ Light client, run the DISPLAY SUB command and filter on the private prefix:

DISPLAY SUB(':private:*')
To view the shared subscriptions that are in use by multiple clients, run the DISPLAY SUB command and filter on the share prefix:
DISPLAY SUB(':share:*')
Because shared subscriptions can be used by multiple MQ Light clients, you might want to view the clients currently consuming messages from the shared subscription. We can do this by listing the Hconns that currently have a handle open on the subscription queue. To view the clients currently using a share, complete the following steps:
  1. Find the queue name that the shared subscription uses as a destination. For example:
    DISPLAY SUB(':private:recv_e298452:public') DEST
       5 : DISPLAY SUB(':private:recv_e298452:public') DEST
    AMQ8096: WebSphere MQ subscription inquired. 
       SUBID(414D5120514D31202020202020202020707E0A565C2D0020) 
       SUB(:private:recv_e298452:public)     
       DEST(SYSTEM.MANAGED.DURABLE.560A7E7020002D5B)
    
  2. Run the DISPLAY CONN command to find the handles open on that queue:
    DISPLAY CONN(*) TYPE(HANDLE) WHERE  (OBJNAME
    EQ SYSTEM.MANAGED.DURABLE.560A7E7020002D5B)
       21 : DISPLAY CONN(*) TYPE(HANDLE) WHERE(OBJNAME EQ
    SYSTEM.MANAGED.DURABLE.560A7E7020002D5B)
    
    AMQ8276: Display Connection details.
       CONN(707E0A56642B0020)                            
       EXTCONN(414D5143514D31202020202020202020)
       TYPE(HANDLE)      
           
       OBJNAME(SYSTEM.BASE.TOPIC)      OBJTYPE(TOPIC) 
    
       OBJNAME(SYSTEM.MANAGED.DURABLE.560A7E7020002961)
       OBJTYPE(QUEUE)           
    
  3. For each of the handles, view the MQ Light client ID that has the handle open:
    DISPLAY CONN(707E0A56642B0020) CLIENTID
       23 : DISPLAY CONN(707E0A56642B0020) CLIENTID
    
    AMQ8276: Display Connection details.
       CONN(707E0A56642B0020)
       EXTCONN(414D5143514D31202020202020202020)
       TYPE(CONN)
       CLIENTID(recv_8f02c9d)
    DISPLAY CONN(707E0A565F290020) CLIENTID
       24 : DISPLAY CONN(707E0A565F290020) CLIENTID
    AMQ8276: Display Connection details.
       CONN(707E0A565F290020)
       EXTCONN(414D5143514D31202020202020202020)
       TYPE(CONN)                               
       CLIENTID(recv_86d8888)
    

Parent topic: Administer IBM MQ Light