Uploaded image for project: 'FUSE Message Broker'
  1. FUSE Message Broker
  2. MB-428

Redelivered messages to consumer skiped due to false duplicate detection on message rollback with Spring and cacheLevel=CACHE_NONE

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 5.0.0.21-fuse
    • Fix Version/s: 5.0.0.25-fuse
    • Component/s: None
    • Labels:
      None
    • Environment:
      Fuse MB 5.0.0.21, activemq-core, ActiveMQMessageConsumer.java
      Spring 2.5.5 DMLC with cacheLevel=CACHE_NONE with JBoss 4.2.2 + XA transactions
    • Similar Issues:
      Show 10 results 

      Description

      Redelivery of message fails after a rollback with Spring DMLC with cacheLevel=CACHE_NONE due to a bug in class : 'org.apache.activemq.ActiveMQMessageConsumer'. Redelivered messages are wrongly detected as duplicates. It fails to call 'rollbackDuplicates' on messages processed by consumer on rollback call on the consumer.

      Sequence: ( See: http://fisheye1.atlassian.com/browse/springframework/spring/src/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java?r=1.14 )

      • Spring creates a transaction
      • Spring creates a JMS consumer
      • Spring give message to Application MessageListener class
      • Spring closes the consumer
      • Spring try to commit
      • Commit fails due to a RuntimeException thrown in Application MessageListener class
      • Spring marks the message as RollbackOnly
      • Spring rollbacks message

      When ActiveMQ closes the consumer ( org.apache.activemq.ActiveMQMessageConsumer ), it clears 'deliveredMessages' list. But this list is needed in rollback method of ActiveMQMessageConsumer to rollback duplicates ! Then consumer cannot rollback duplicates on rollback if consumer is closed before rollback action.

      The only way I found, is to not clear 'deliveredMessages' list on close. It seems, there is no side effect, since after a call to 'close' method, the consumer is not used anymore.

        Gliffy Diagrams

          Activity

          Hide
          joe.luo Joe Luo added a comment -

          The patch was created against Fuse MB 5.2.0.0-fuse tag version.

          Show
          joe.luo Joe Luo added a comment - The patch was created against Fuse MB 5.2.0.0-fuse tag version.
          Hide
          garytully Gary Tully added a comment -

          I have produced a little test case for this and will commit it and a fix shortly via apache https://issues.apache.org/activemq/browse/AMQ-2032

          will pull that down and deploy a 5.0.0-fuse-SNAPSHOT later today.

          Show
          garytully Gary Tully added a comment - I have produced a little test case for this and will commit it and a fix shortly via apache https://issues.apache.org/activemq/browse/AMQ-2032 will pull that down and deploy a 5.0.0-fuse-SNAPSHOT later today.
          Hide
          garytully Gary Tully added a comment -

          completed the commit to the 5.0.0-fuse branch. It will be in the next snapshot and the release will follow once we do a sanity using the original complete test case.

          Show
          garytully Gary Tully added a comment - completed the commit to the 5.0.0-fuse branch. It will be in the next snapshot and the release will follow once we do a sanity using the original complete test case.
          Hide
          garytully Gary Tully added a comment -

          this won't make 5.0.0.24 as I have just completed the fix today.
          latest fix is at https://issues.apache.org/activemq/browse/AMQ-2034

          Show
          garytully Gary Tully added a comment - this won't make 5.0.0.24 as I have just completed the fix today. latest fix is at https://issues.apache.org/activemq/browse/AMQ-2034
          Hide
          garytully Gary Tully added a comment -

          fix can be verified in tonights snapshot build

          Show
          garytully Gary Tully added a comment - fix can be verified in tonights snapshot build

            People

            • Assignee:
              garytully Gary Tully
              Reporter:
              joe.luo Joe Luo
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: