Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: MB-428
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Gary Tully
Reporter: Joe Luo
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
FUSE Message Broker

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

Created: 10/Dec/08 07:06 AM   Updated: 15/Dec/08 04:00 PM
Component/s: None
Affects Version/s: 5.0.0.21-fuse
Fix Version/s: 5.0.0.25-fuse

File Attachments: 1. Text File ActiveMQMessageConsumer-5.2.0.0-fuse.patch (4 kB)

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

External Issue URL: https://issues.apache.org/activemq/browse/AMQ-2032


 Description  « Hide
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.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Joe Luo added a comment - 10/Dec/08 07:17 AM
The patch was created against Fuse MB 5.2.0.0-fuse tag version.

Gary Tully added a comment - 11/Dec/08 08:21 AM
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.


Gary Tully added a comment - 11/Dec/08 12:47 PM
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.

Gary Tully added a comment - 15/Dec/08 02:33 PM
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

Gary Tully added a comment - 15/Dec/08 03:59 PM
fix can be verified in tonights snapshot build