Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-4687

Rar losing messages when there is a XA trx timeout (jboss)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Duplicate
    • 5.6.0
    • 5.x
    • None
    • None
    • Jboss 6.0.1, JDK 1.6, ActiveMQ 5.6

    Description

      ActiveMQ does a trx commit when there is a transaction timeout (EJBTransactionRolledbackException). In this way we are losing messages when there is any timeout.
      We have seen that the activemq connections are enlist in XA.
      The attribute transactionContext from ActiveMQSession class has the global transaction reference (xid) before calling the MDB (messageListener.onMessage(message)).
      When the timeout is reached and the RuntimeException is throwned, the transactionContext losed the xid reference.
      Later, when ActiveMQSession call the method transactionContext.isInXATransaction() the result is false because there is no xid reference.

      This situation only happened when the MDB calls other EJB (Stateless) with CMT - TransactionAttributeType.REQUIRES_NEW, and the exception is throwed inside the Stateless.

      I've tried to reproduce this without calling the stateless ejb but it works well.
      The ActiveMQSession class should retain the original transactionContext.

      I found these is the same problem jira https://issues.apache.org/jira/browse/AMQ-4634 but is possible move this fix into version ActiveMQ 5.6 ?

      Regards

      Attachments

        Activity

          People

            Unassigned Unassigned
            juanlopez Juan Manuel Lopez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: