3 Replies Latest reply on Nov 18, 2005 7:10 PM by Adrian Brock

    Massive increase of TCP/IP connections when opening JMS conn

    christof kaleschke Newbie

      Hi,

      I have an interesting problem with UIL2 in JBoss 4.0.2 (Windows). When I open a JMS-connection using UIL2 and close it immediately afterwards and repeat this over and over again, the amount of open TCP/IP connections increases massively (although I close the connections). This problem is relevant if you have clients that hold their JMS-connection only for sending/receiving a message and close it immediately afterwards.

      When I call netstat -a I get a long long list of open TCP/IP connections.

      Is there a way to get around this? E.g. set some kind of timeout parameter? Any help is appreciated.

      You can reproduce this problem with following code:

      for (int i = 0; i < 10000; i++) {
      InitialContext initCtx = new InitialContext();
      TopicConnectionFactory tcf = (TopicConnectionFactory)initCtx.lookup
      ("ConnectionFactory");
      TopicConnection connection = tcf.createTopicConnection();
      Topic topic = (Topic) initCtx.lookup("topic/jmsTestTopic");
      TopicSession session = connection.createTopicSession(false,
      QueueSession.AUTO_ACKNOWLEDGE);
      connection.start();

      connection.stop();
      session.close();
      connection.close();
      }

      Thanks

      Christof