Qpid
  1. Qpid
  2. QPID-3625

XASessionImpl Incorrectly sets Session acknowledge mode to AUTO_ACKNOWLEDGE when it should be CLIENT_ACKNOWLEDGE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.10, 0.12
    • Fix Version/s: 0.15
    • Component/s: Java Client
    • Labels:
      None
    • Environment:

      All platforms

      Description

      When using distributed transactions (XA) message acknowledgement needs to occur prior to the XA transaction being started in order to consistently support the two phase commit protocol. In order for this to correctly occur, the XASessionImpl, a non-transacted Session (i.e. non JMS transacted session) should be configured to use CLIENT_ACKNOWLEDGE as this is the only mode that supports explicit message acknowledgement which again, is required to correctly participate in the distributed transaction.

      1. QPID3625-XASession.patch
        7 kB
        Weston M. Price
      2. QPID-3625.patch
        1 kB
        Weston M. Price

        Activity

        Hide
        Weston M. Price added a comment -

        Patch for QPID-3625 to use CLIENT_ACKNOWLEDGE in XASessionImpl

        Show
        Weston M. Price added a comment - Patch for QPID-3625 to use CLIENT_ACKNOWLEDGE in XASessionImpl
        Hide
        Rajith Attapattu added a comment -

        Discussed this issue with Weston and I agree that CLIENT_ACK is the more suitable option here.

        Show
        Rajith Attapattu added a comment - Discussed this issue with Weston and I agree that CLIENT_ACK is the more suitable option here.
        Hide
        Rajith Attapattu added a comment -

        This change was tested by Weston in an app server environment.

        Show
        Rajith Attapattu added a comment - This change was tested by Weston in an app server environment.
        Hide
        Keith Wall added a comment -

        Hi Weston/Rajith,

        It appears that this commit broke the Java/Cpp build. Three XA tests are now failing.

        First failing build was:

        https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-Java-Cpp-Test/143/

        Would you take a look?
        cheers,
        Keith.

        Show
        Keith Wall added a comment - Hi Weston/Rajith, It appears that this commit broke the Java/Cpp build. Three XA tests are now failing. First failing build was: https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-Java-Cpp-Test/143/ Would you take a look? cheers, Keith.
        Hide
        Rajith Attapattu added a comment -

        Keith, after some investigation we've determined that CLIENT_ACK is not correct and AUTO_ACK is the easiest way to handle the general case.
        For the specific JCA case we are exploring the possibility of using CLIENT_ACK by modifying the ack mode runtime. Weston will produce a patch for this shortly.

        Since the change is reversed the test cases should now all pass.

        Show
        Rajith Attapattu added a comment - Keith, after some investigation we've determined that CLIENT_ACK is not correct and AUTO_ACK is the easiest way to handle the general case. For the specific JCA case we are exploring the possibility of using CLIENT_ACK by modifying the ack mode runtime. Weston will produce a patch for this shortly. Since the change is reversed the test cases should now all pass.
        Hide
        Weston M. Price added a comment -

        Patch allowing for setting ackmode for XASessionImpl

        Show
        Weston M. Price added a comment - Patch allowing for setting ackmode for XASessionImpl
        Hide
        Weston M. Price added a comment -

        I have attached a patch QPID3625-XASession.patch that allows for setting the ack mode for an XASession. This is need for JEE message listeners and JCA adapters where the XATransaction is started/ended/comitted in the onMessage() method. As a result, we need to be able to set the ackmode to CLIENT_ACKNOWLEDGE so we can acknowledge the message in the onMessage invocation rather than allowing the JMS client to do it after the method ends.

        Show
        Weston M. Price added a comment - I have attached a patch QPID3625-XASession.patch that allows for setting the ack mode for an XASession. This is need for JEE message listeners and JCA adapters where the XATransaction is started/ended/comitted in the onMessage() method. As a result, we need to be able to set the ackmode to CLIENT_ACKNOWLEDGE so we can acknowledge the message in the onMessage invocation rather than allowing the JMS client to do it after the method ends.
        Hide
        Weston M. Price added a comment -

        We reverted to using AUTO_ACK due to regressions but provide a facility for the JCA adapter to correctly specify CLIENT_ACK for JEE integration.

        Show
        Weston M. Price added a comment - We reverted to using AUTO_ACK due to regressions but provide a facility for the JCA adapter to correctly specify CLIENT_ACK for JEE integration.

          People

          • Assignee:
            Unassigned
            Reporter:
            Weston M. Price
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development