title: Understanding remote JMS connections within JBoss EAP 6.4 (HornetQ)
body: <p>We have some issues with too many TCP connections in our environment so we are trying to limit as many connections as possible. Therefore, I've set the activation configuration property <code>maxSession</code> to <code>1</code> to all our remote MDBs:</p>
  
  <pre class="lang-java prettyprint-override"><code>@MessageDriven(activationConfig = {
          @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
          @ActivationConfigProperty(propertyName = "user", propertyValue = "jmsuser"),
          @ActivationConfigProperty(propertyName = "password", propertyValue = "xxxx"),
          @ActivationConfigProperty(propertyName = "minSession", propertyValue = "1"),
          @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1"),
          @ActivationConfigProperty(propertyName = "destination", propertyValue = "myQueue"),
          @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=127.0.0.1;port=5545"),
          @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory") }, 
  mappedName = "myQueue")
  public class ReadQueueTest implements MessageListener {
  
      @Override
      public void onMessage(Message msg) {
          //do something...   
      }
  }
  </code></pre>
  
  <p>After starting the application within one MDB I get the following TCP connections:</p>
  
  <pre><code>######:~ user$ netstat -an | grep 5545 | grep ESTA
  tcp4       0      0  127.0.0.1.5545         127.0.0.1.64644        ESTABLISHED
  tcp4       0      0  127.0.0.1.64644        127.0.0.1.5545         ESTABLISHED
  tcp4       0      0  127.0.0.1.5545         127.0.0.1.64643        ESTABLISHED
  tcp4       0      0  127.0.0.1.64643        127.0.0.1.5545         ESTABLISHED
  </code></pre>
  
  <p>After a few minutes the connection count is increasing:</p>
  
  <pre><code>######:~ user$ netstat -an | grep 5545 | grep ESTA
  tcp4       0      0  127.0.0.1.5545         127.0.0.1.64652        ESTABLISHED
  tcp4       0      0  127.0.0.1.64652        127.0.0.1.5545         ESTABLISHED
  tcp4       0      0  127.0.0.1.5545         127.0.0.1.64644        ESTABLISHED
  tcp4       0      0  127.0.0.1.64644        127.0.0.1.5545         ESTABLISHED
  tcp4       0      0  127.0.0.1.5545         127.0.0.1.64643        ESTABLISHED
  tcp4       0      0  127.0.0.1.64643        127.0.0.1.5545         ESTABLISHED
  </code></pre>
  
  <p>Can somebody tell me why there are so many connections, and why is it increasing? Is it possible to limit the TCP connections to one for each remote MDB? </p>
  
  <p>We are using JBoss EAP 6.4 with HornetQ.</p>