[ https://issues.apache.org/jira/browse/AMQ-5790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16777862#comment-16777862 ]
Gary Tully commented on AMQ-5790: --------------------------------- AMQ-4486 needs to be reworked to resolve this, rather than using a new connection per xa op, sharing a single connection that is scoped by the RAR start/stop makes sense. The RAR always needs to be deployed to provide the mechanism to connect and stop/start is part of the deployment contract such that there will be no dangling connections. > Huge number of TIME_WAIT connections observed while using activemq resource > adapter with EAP6 > --------------------------------------------------------------------------------------------- > > Key: AMQ-5790 > URL: https://issues.apache.org/jira/browse/AMQ-5790 > Project: ActiveMQ > Issue Type: Bug > Components: Broker, RAR > Affects Versions: 5.9.0, 5.11.0 > Environment: ALL > Reporter: JaySenSharma > Priority: Major > > - While using activemq resource adapter (activemq-rar-5.9.0.rar or higher) > on JBoss EAP 6.3 side it can be noticed that thousand of TIME_WAIT tcp > connections are getting created every 2-3 minutes interval. These TIME_WAIT > sockets are fluctuating from thousand (like 2000-3000) to 1 in every 2-3 > minutes of interval. > Following are the steps to reproduce this issue: > *Step-1).* Configure AMQ broker to listen on "61621" then start it. > *Step-2).* Deploy the "activemq-rar.rar" (5.9 vesion) to standalone instance > of JBoss EAP 6.3 and use the attached "standalone-full.xml" file to start the > EAP6.3 as ot has the resource-adapter configuration in it. > {code} > cd jboss-eap-6.3.0/bin > ./standalone.sh -c standalone-full.xml > {code} > *Step-3).* Deploy the a simple MDB based application like an EAR containing > around 20 MDBs listening to 20 different queues present on the A-MQ side. All > these MDBs are very simple MDBs and just displays the received TextMessages. > These MDBs have the following annotations in it (see maxSessions = 1). > {code} > @MessageDriven(activationConfig={@javax.ejb.ActivationConfigProperty(propertyName="destination", > propertyValue="java:/jms/queue1/1.0"), > @javax.ejb.ActivationConfigProperty(propertyName="useJndi", > propertyValue="true"), > @javax.ejb.ActivationConfigProperty(propertyName="destinationType", > propertyValue="javax.jms.Queue"), > @javax.ejb.ActivationConfigProperty(propertyName="acknowledgeMode", > propertyValue="Auto-acknowledge"), > @javax.ejb.ActivationConfigProperty(propertyName="maximumRedeliveries", > propertyValue="6"), > @javax.ejb.ActivationConfigProperty(propertyName="initialRedeliveryDelay", > propertyValue="5000"), > @javax.ejb.ActivationConfigProperty(propertyName="maxSessions", > propertyValue="1")}) > . > . > public void onMessage(Message message) { > TextMessage textMessage = (TextMessage) message; > try { > log.info("SimpleMdb1 received a message" + textMessage.getText()); > } > catch (JMSException e) { > log.info("Error in SimpleMdb1 while received a message"); > } > } > {code} > *Step-4).* Execute the following command and notice around thousand TCP > connections as following: > {code} > netstat -tnlpa | grep TIME_WAIT | grep 61621 > ---------------------------------- > tcp6 0 0 127.0.0.1:61621 127.0.0.1:39199 TIME_WAIT > - > tcp6 0 0 127.0.0.1:61621 127.0.0.1:39461 TIME_WAIT > - > tcp6 0 0 127.0.0.1:61621 127.0.0.1:39935 TIME_WAIT > - > tcp6 0 0 127.0.0.1:61621 127.0.0.1:38999 TIME_WAIT > - > tcp6 0 0 127.0.0.1:61621 127.0.0.1:39139 TIME_WAIT > - > tcp6 0 0 127.0.0.1:61621 127.0.0.1:39922 TIME_WAIT > - > tcp6 0 0 127.0.0.1:61621 127.0.0.1:40027 TIME_WAIT > - > tcp6 0 0 127.0.0.1:61621 127.0.0.1:38908 TIME_WAIT > - > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)