4 Replies Latest reply on Jan 21, 2010 8:06 AM by simo.nikula1

    How do I shutdown JMS-connection for ClusteredConnectionFactory

    simo.nikula1

      Hi

       

      I wonder if I'm missing some trivial point or just trying unusual thing.

      I have application that needs JMS connection for some methods and I

      would like to avoid network load related to pinging connection.

       

      To do this I have time that closes JMS connection if it has been idle for given time (10 minutes)

      but it closes only active JMS connection and connection to other host remains active and does pinging.

       

      Simo

        • 1. Re: How do I shutdown JMS-connection for ClusteredConnectionFactory
          gaohoward

          Hi Simo,

           

          I'm not sure I understand your issue, can you give me the code piece that you use to close the connections?


          By the way, for user related problems we have a user forum. This forum is for development only.

           

          Thanks

          Howard

          • 2. Re: How do I shutdown JMS-connection for ClusteredConnectionFactory
            simo.nikula1

            Hi Howard,

             

            I maybe should have used user forum but this may turn into development issue.

             

            I have cluster of two servers.

            closing code is just javax.jms.Connection.close();

            Connection is obtained by basically (typecasting left out)

            InitialContext.lookup("/ClusteredConnectionFactory").createTopicConnection();

             

            When I check with lsof and tcpdump only connection to one server is closed and pinging continues on other.

            • 3. Re: How do I shutdown JMS-connection for ClusteredConnectionFactory
              gaohoward

              Hi Simo,

               

              Each time you create a connection, the client will get a new connection to one of your cluster servers. That means for each connection got from createTopicConnection(), you need to close it.

               

              if you have the output of lsof/tcpdump that can prove the connection ping, can you post here so I can have a better understanding of the issue?

               

              Thanks

              Howard

              • 4. Re: How do I shutdown JMS-connection for ClusteredConnectionFactory
                simo.nikula1

                h2. Ports used

                After prefix of 275 (standard jboss ports)

                * 26 HAJNDI/RmiPort (1001)
                * 50 JBM bisocket (1090)
                * 71 JBM bisocket/secondaryBindPort (random, fixed due to firewall)


                h3.  Right after connection usage

                {noformat}
                        [root@localhost /etc]#  netstat -anp | grep ':275'
                        tcp        0      0 ::ffff:131.177.92.101:52296 ::ffff:131.177.70.47:27571  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:52332 ::ffff:131.177.70.47:27571  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:57994 ::ffff:131.177.70.47:27526  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:43689 ::ffff:131.177.70.47:27550  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:43685 ::ffff:131.177.70.47:27550  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:58688 ::ffff:131.177.70.46:27550  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:58652 ::ffff:131.177.70.46:27550  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:37998 ::ffff:131.177.70.46:27526  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:45526 ::ffff:131.177.70.46:27571  ESTABLISHED 13775/java     
                {noformat}
                h3.  after waiting for while after Connection.close() 
                {noformat}
                         [root@localhost /etc]#  netstat -anp | grep ':275'
                        tcp        0      0 ::ffff:131.177.92.101:55895 ::ffff:131.177.70.47:27550  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:55894 ::ffff:131.177.70.47:27550  ESTABLISHED 13775/java         
                        tcp        0      0 ::ffff:131.177.92.101:52332 ::ffff:131.177.70.47:27571  ESTABLISHED 13775/java         
                {noformat}
                h4.  connection is still pinged
                {noformat}
                         [root@localhost /etc]# tcpdump -i any -nn 'port 27550 || port 27571'
                        tcpdump: WARNING: Promiscuous mode not supported on the "any" device
                        tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
                        listening on any, link-type LINUX_SLL (Linux cooked), capture size 96 bytes
                        14:28:47.395349 IP 131.177.92.101.55894 > 131.177.70.47.27550: P 1940044237:1940044633(396) ack 2748921997 win 502 <nop,nop,timestamp 108477996 2903384612>
                        14:28:47.425310 IP 131.177.92.101.55894 > 131.177.70.47.27550: . ack 215 win 502 <nop,nop,timestamp 108478026 2903386614>
                        14:28:49.397282 IP 131.177.92.101.55894 > 131.177.70.47.27550: P 396:792(396) ack 215 win 502 <nop,nop,timestamp 108479998 2903386614>
                        14:28:49.426855 IP 131.177.92.101.55894 > 131.177.70.47.27550: . ack 429 win 502 <nop,nop,timestamp 108480027 2903388615>
                        14:28:51.399219 IP 131.177.92.101.55894 > 131.177.70.47.27550: P 792:1188(396) ack 429 win 502 <nop,nop,timestamp 108482000 2903388615>
                        14:28:51.428344 IP 131.177.92.101.55894 > 131.177.70.47.27550: . ack 643 win 502 <nop,nop,timestamp 108482029 2903390617>
                        14:28:51.478363 IP 131.177.92.101.55895 > 131.177.70.47.27550: . 1938645981:1938647285(1304) ack 2181599115 win 502 <nop,nop,timestamp 108482079 2903380720>
                        14:28:51.478426 IP 131.177.92.101.55895 > 131.177.70.47.27550: P 1304:1594(290) ack 1 win 502 <nop,nop,timestamp 108482079 2903380720>
                        14:28:51.535034 IP 131.177.92.101.55895 > 131.177.70.47.27550: . ack 439 win 502 <nop,nop,timestamp 108482136 2903390722>

                {noformat}