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


    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s:
    • Fix Version/s:
    • Component/s: None
    • Labels:
    • Environment:

      Fuse MB, activemq-core, ActiveMQMessageConsumer.java
      Spring 2.5.5 DMLC with cacheLevel=CACHE_NONE with JBoss 4.2.2 + XA transactions


      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




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


                • Created: