0 Replies Latest reply on Apr 12, 2006 4:05 PM by yuan yuan

    repeatedly connect createSubscriber ,close ,stop,I found the

    yuan yuan Newbie

      firstly ,it's my code ,and setuptopic() and disconnectAndDestroyAllNotificationReceivers() will be invoked by another Jmx: MBean .connect() and disconnect() seperately.
      in another word ,I will invoke these two methods by Jmx Manage Bean .

      public void setupTopic() throws JMSException, NamingException {
       iniCtx = new InitialContext();
       Object tmp = iniCtx.lookup("ConnectionFactory");
       String alarmTopicName ="topic/ALARMNOTIFICATIONS";
       String connectStatusTopicName ="topic/OSNOTIFICATIONS";
       TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
       //topic = (Topic) iniCtx.lookup(alarmTopicName);
       topic2 = (Topic) iniCtx.lookup(connectStatusTopicName);
       conn = tcf.createTopicConnection();
       session = conn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
      public void disconnectAndDestroyAllNotificationReceivers() {
       try {
       iniCtx = null;
       conn = null;
       session = null;
       topic = null;
       topic2 = null;
       } catch (Exception e) {

      then please care the following diagram:

      once I disconnect and then connect again.(invoke setupTopic)
      the following threads will be added .(of courese ,#n will keep increasing).
      but after I disconnect ,all these threads never be released(disappear),

      Thread[UIL2.SocketManager.ReadTask#9 client=](Running)
      Thread[UIL2.SocketManager.ReadTask#10 client=](Running)
      Thread[UIL2.SocketManager.ReadTask#11 client=](Running)
      Thread[UIL2.SocketManager.ReadTask#12 client=](Running)

      I am worried this will impact on the performance of Jboss.
      I want to learn what 's those threads ,
      how to get rid of them after I disconnect from Jms.

      the following threads will be released by jboss and disappear.
      name like