You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/02/01 18:31:19 UTC

svn commit: r374120 - /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java

Author: gnodet
Date: Wed Feb  1 09:31:16 2006
New Revision: 374120

URL: http://svn.apache.org/viewcvs?rev=374120&view=rev
Log:
Workaround for http://jira.activemq.org/jira/browse/AMQ-519

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java?rev=374120&r1=374119&r2=374120&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java Wed Feb  1 09:31:16 2006
@@ -45,6 +45,7 @@
 import org.apache.activemq.advisory.AdvisorySupport;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.ActiveMQObjectMessage;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.activemq.command.ActiveMQTopic;
 import org.apache.activemq.command.ConsumerId;
@@ -459,6 +460,10 @@
                         processInBoundPacket(containerName, event);
                     }
                     else if (obj instanceof MessageExchangeImpl) {
+                        // Hack for redelivery: AMQ is too optimized and the object is the same upon redelivery
+                        // so that there are side effect (the exchange state may have been modified)
+                        // See http://jira.activemq.org/jira/browse/AMQ-519
+                        obj = ((ActiveMQObjectMessage) ((ActiveMQObjectMessage) message).copy()).getObject();
                         MessageExchangeImpl me = (MessageExchangeImpl) obj;
                         TransactionManager tm = (TransactionManager) getTransactionManager();
                         if (tm != null) {