Obtaining a connection ID associated with a temporary queue or topic.

Obtaining a connection ID associated with a temporary queue or topic.

book

Article ID: KB0093373

calendar_today

Updated On:

Products Versions
TIBCO Enterprise Message Service -
Not Applicable -

Description

Description:
1). In tibemsadmin, "show queue <temp_queue>" or "show topic <temp_topic>" can show the connection ID.  

Example:

 tcp://localhost:7222> show queue $TMP$.EMS-SERVER.2F4C54382DA5F.1
 Queue:                 $TMP$.EMS-SERVER.2F4C54382DA5F.1
 Type:                  temporary, connectionID: 12
 Properties:            prefetch=5,store=$sys.nonfailsafe
 JNDI Names:            <none>
 Bridges:               <none>
 Receivers:             1
 Pending Msgs:          0, (0 persistent)
 Delivered Msgs:        0
 Pending Msgs Size:     0.0 Kb, (0.0 Kb persistent)

tcp://localhost:7222> show topic $TMP$.EMS-SERVER.2F4C54382DA51E.1
 Topic:                 $TMP$.EMS-SERVER.2F4C54382DA51E.1
 Type:                  temporary, connectionID: 27
 Properties:            prefetch=64,store=$sys.nonfailsafe
 JNDI Names:            <none>
 Bridges:               <none>
 Subscriptions:         1
 Durable Subscriptions: 0
 Consumers:             1
 Durable Consumers:     0
 Pending Msgs:          0, (0 persistent)
 Pending Msgs Size:     0.0 Kb, (0.0 Kb persistent)
 Total Inbound Msgs:    0
 Total Inbound Bytes:   0.0 Kb
 Total Outbound Msgs:   0
 Total Outbound Bytes:  0.0 Kb

The command "show connections full" shows that they are created by applications as shown below:

tcp://localhost:7222> show connections full
L  Version   ID  FSXT  S  Host      IP address User      ClientID                             Sess Prod Cons TmpT TmpQ Uncomm UncommSize     Uptime
C  8.0.0 V9  12  ---A  +  m1 [::1]      admin                                             1    1    1    0    1      0     0.0 Kb   95:16:09
J  7.0.0 V12 27  ---T  +  m1 [::1]      anonymous                                         1    1    1    1    0      0     0.0 Kb     18.806

2).  If there is no consumer on the temporary destination, it means that the application has closed the consumer but is still connected to the EMS server. 

Example:

tcp://localhost:7222> show topic $TMP$.EMS-SERVER.2F4C54382DA522.1
 Topic:                 $TMP$.EMS-SERVER.2F4C54382DA522.1
 Type:                  temporary, connectionID: 31
 Properties:            prefetch=64,store=$sys.nonfailsafe
 JNDI Names:            <none>
 Bridges:               <none>
 Subscriptions:         0
 Durable Subscriptions: 0
 Consumers:             0
 Durable Consumers:     0
 Pending Msgs:          0, (0 persistent)
 Pending Msgs Size:     0.0 Kb, (0.0 Kb persistent)
 Total Inbound Msgs:    0
 Total Inbound Bytes:   0.0 Kb
 Total Outbound Msgs:   0
 Total Outbound Bytes:  0.0 Kb

Prior to EMS 8.2, there was no way to obtain the connection ID by using the Admin API. The API will be implemented in a future release of EMS. In EMS 8.2, connectionID() in com.tibco.tibjms.admin.DestinationInfo class can be used to obtain connection ID.

3). If there is no connection ID on the temporary destination,  the following will be shown. 

Example:

tcp://localhost:7022> show topic $TMP$.EMS-SERVER.138C543DAA566.1
 Topic:                 $TMP$.EMS-SERVER.138C543DAA566.1
 Type:                  temporary, connectionID: 0
 Properties:            prefetch=64,store=$sys.nonfailsafe
 JNDI Names:            <none>
 Bridges:               <none>
 Consumers:             0
 Durable Consumers:     0
 Pending Msgs:          0, (0 persistent)
 Pending Msgs Size:     0.0 Kb, (0.0 Kb persistent)
 Total Inbound Msgs:    1
 Total Inbound Bytes:   0.1 Kb
 Total Outbound Msgs:   1
 Total Outbound Bytes:  0.1 Kb

This temporary destination is created by a producer that sends the reply in a request-reply scenario across a route. 
EMS will remove such temporary destinations every 3 minutes.

Issue/Introduction

Obtaining a connection ID associated with a temporary queue or topic.

Resolution

Prior to EMS 8.2, the following EMS Admin API can be used to obtain the connection ID:

      TibjmsAdmin admin = new TibjmsAdmin(serverUrl,username,password);

       // QueueInfo qi= new QueueInfo("$TMP$.EMS-SERVER.2F4C54382DA5F.1"); 
       // ConsumerInfo[] ci=   admin.getConsumers(null,null,queue,false,0);

        TopicInfo ti = new TopicInfo("$TMP$.EMS-SERVER.2F4C54382DA51E.1");
        ConsumerInfo[] ci =   admin.getConsumers(null,null,topic,false,0);

        for (int j=0; j<ci.length; j++)
        {
            System.out.println(ci[j].getConnectionID());
        }

For EMS 8.2:

        QueueInfo qi = admin.getQueue("$TMP$.EMS-SERVER.3BF2054BD95C93.1");
        long id = qi.connectionID();

Additional Information

EMS Java Admin API