Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10503

ActiveMQ leaks connections if a JMS message is sent from an MDB

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 7.1.0.DR16, 7.1.0.DR18, 7.1.0.ER2, 7.1.0.CR2, 7.2.0.GA
    • JMS, Transactions
    • None
    • Hide

      Steps to reproduce:

      git clone git://git.app.eng.bos.redhat.com/jbossqe/eap-tests-hornetq.git
      cd eap-tests-hornetq/scripts/
      git checkout master
      
      groovy -DEAP_VERSION=7.1.0.ER2.2 PrepareServers7.groovy
      export WORKSPACE=$PWD
      export JBOSS_HOME_1=$WORKSPACE/server1/jboss-eap
      export JBOSS_HOME_2=$WORKSPACE/server2/jboss-eap
      export JBOSS_HOME_3=$WORKSPACE/server3/jboss-eap
      export JBOSS_HOME_4=$WORKSPACE/server4/jboss-eap
      
      cd ../jboss-hornetq-testsuite/
      mvn clean test -Dtest=MdbWithCdiTestCase#testSendReceiveMdbWithCdi  -DfailIfNoTests=false -Deap=7x  | tee log
      
      Show
      Steps to reproduce: git clone git: //git.app.eng.bos.redhat.com/jbossqe/eap-tests-hornetq.git cd eap-tests-hornetq/scripts/ git checkout master groovy -DEAP_VERSION=7.1.0.ER2.2 PrepareServers7.groovy export WORKSPACE=$PWD export JBOSS_HOME_1=$WORKSPACE/server1/jboss-eap export JBOSS_HOME_2=$WORKSPACE/server2/jboss-eap export JBOSS_HOME_3=$WORKSPACE/server3/jboss-eap export JBOSS_HOME_4=$WORKSPACE/server4/jboss-eap cd ../jboss-hornetq-testsuite/ mvn clean test -Dtest=MdbWithCdiTestCase#testSendReceiveMdbWithCdi -DfailIfNoTests= false -Deap=7x | tee log

      If an MDB causes a JMS message to be sent during the call to onMessage(), ActiveMQ won't close its connection. I'm using JMS2 through an @Inject'ed JMSContext. My sample project is an EAR with an EJB JAR (containing a service and an MDB) and a JAX-RS endpoint (entry point for the test).

      1) Build the EAR
      2) Run wildfly with the standalone-full.xml configuration:
      standalone.bat --server-config=standalone-full.xml
      3) Enable debug and error reporting for leaked connections with ActiveMQ/CCM:
      jboss-cli.bat -c
      /subsystem=jca/cached-connection-manager=cached-connection-manager:write-attribute(name=debug,value=true)
      /subsystem=jca/cached-connection-manager=cached-connection-manager:write-attribute(name=error,value=true)
      4) Deploy the EAR.
      5) Access http://localhost:8080/leak-web/rest/test?message=Hi

      The REST endpoint will send a message to the test topic (Defined in leak-ejb/src/main/java/test/mdb/TestTopic.java). TestTopicListener (in the same package as TestTopic) will receive the message and send a second message to the topic. Upon returning from TestTopicListener.onMessage(), the message is sent, but this shows up in the logs

      (see attached log.txt)

      I have no idea why JIRA attached each file twice.

        1. leak.zip
          26 kB
        2. leak.zip
          26 kB
        3. log.txt
          32 kB
        4. log.txt
          32 kB
        5. server.log
          40 kB

              jmesnil1@redhat.com Jeff Mesnil
              mnovak1@redhat.com Miroslav Novak
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: