activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r830320 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp: Commands/Message.cs MessageConsumer.cs
Date Tue, 27 Oct 2009 20:01:08 GMT
Author: tabish
Date: Tue Oct 27 20:01:08 2009
New Revision: 830320

URL: http://svn.apache.org/viewvc?rev=830320&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQNET-176

Added call to OnMessageRollback method when a transaction is rollback to properly update the
Message state.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs?rev=830320&r1=830319&r2=830320&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs
Tue Oct 27 20:01:08 2009
@@ -166,6 +166,11 @@
             this.ReadOnlyBody = true;
         }
 
+        public virtual void OnMessageRollback()
+        {
+            this.redeliveryCounter++;
+        }
+
         public bool IsExpired()
         {
             return this.expiration == 0 ? false : DateTime.UtcNow > DateUtils.ToDateTimeUtc(this.expiration);

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=830320&r1=830319&r2=830320&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs
Tue Oct 27 20:01:08 2009
@@ -823,6 +823,12 @@
                     }
                     
                     MessageId firstMsgId = this.dispatchedMessages.Last.Value.Message.MessageId;
+
+                    foreach(MessageDispatch dispatch in this.dispatchedMessages)
+                    {
+                        // Allow the message to update its internal to reflect a Rollback.
+                        dispatch.Message.OnMessageRollback();
+                    }
         
                     //if(redeliveryPolicy.getMaximumRedeliveries() != RedeliveryPolicy.NO_MAXIMUM_REDELIVERIES
                     //    && lastMd.getMessage().getRedeliveryCounter() > redeliveryPolicy.getMaximumRedeliveries())
{



Mime
View raw message