Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-2389

Message sent after transaction timeout and rollback

XMLWordPrintable

    • +
    • Hide
      @Resource(mappedName = "java:/TransactionManager")
      private TransactionManager tm;
      ...
      if (tm.getStatus() != Status.STATUS_ACTIVE) {
          throw new RuntimeException("TX not active");
      }
      producer.send(message);
      ...
      
      Show
      @Resource(mappedName = "java:/TransactionManager" ) private TransactionManager tm; ... if (tm.getStatus() != Status.STATUS_ACTIVE) { throw new RuntimeException( "TX not active" ); } producer.send(message); ...
    • Hide
      bin/standalone.sh -b localhost -bmanagement localhost -c eap.xml
      
      # config (tx timeout: 2s)
      bin/jboss-cli.sh --controller=localhost:9990 -u=admin -p=admin -c
      /subsystem=logging/logger=org.apache.activemq.transport.TransportLogger:add(level=DEBUG)
      /subsystem=logging/logger=com.arjuna:add(level=TRACE)
      /subsystem=transactions:write-attribute(name=default-timeout,value=2)
      /subsystem=transactions:write-attribute(name=enable-statistics,value=true)
      
      # app (sleep before producer send: 2.5s)
      cd wildfly-soap-service
      mvn install -Pdeploy
      #mvn clean -Pdeploy
      
      curl -H "Content-Type: text/xml;charset=UTF-8" -d '
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fv="http://it.fvaleri.integ/hello">
          <soapenv:Header />
          <soapenv:Body>
              <fv:writeText>
                  <arg0>test0</arg0>
              </fv:writeText>
          </soapenv:Body>
      </soapenv:Envelope>' http://localhost:8080/services/HelloService/Hello
      
      Show
      bin/standalone.sh -b localhost -bmanagement localhost -c eap.xml # config (tx timeout: 2s) bin/jboss-cli.sh --controller=localhost:9990 -u=admin -p=admin -c /subsystem=logging/logger=org.apache.activemq.transport.TransportLogger:add(level=DEBUG) /subsystem=logging/logger=com.arjuna:add(level=TRACE) /subsystem=transactions:write-attribute(name= default -timeout,value=2) /subsystem=transactions:write-attribute(name=enable-statistics,value= true ) # app (sleep before producer send: 2.5s) cd wildfly-soap-service mvn install -Pdeploy #mvn clean -Pdeploy curl -H "Content-Type: text/xml;charset=UTF-8" -d ' <soapenv:Envelope xmlns:soapenv= "http: //schemas.xmlsoap.org/soap/envelope/" xmlns:fv= "http://it.fvaleri.integ/hello" > <soapenv:Header /> <soapenv:Body> <fv:writeText> <arg0>test0</arg0> </fv:writeText> </soapenv:Body> </soapenv:Envelope>' http: //localhost:8080/services/HelloService/Hello

      Due to TX timeout (30s by default), the rollback happens before the producer sends the message to the broker. It looks like there is a pending producer.send() that still happen in the wrong context (possibly without a transaction). This is rare (2 times in the last 6 months).

      EAP 7.0 Update 9 (activemq-rar-5.11.0.redhat-630356.rar) connecting to AMQ 6.3.0 Rollup 9.

        1. wildfly-soap-service.zip
          9 kB
        2. server.log
          46 kB
        3. eap.xml
          23 kB

              gtully@redhat.com Gary Tully
              rhn-support-fvaleri Federico Valeri
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: