activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r831619 - /activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/policies/RedeliveryPolicy.cs
Date Sat, 31 Oct 2009 23:48:04 GMT
Author: tabish
Date: Sat Oct 31 23:48:04 2009
New Revision: 831619

URL: http://svn.apache.org/viewvc?rev=831619&view=rev
Log:
* RedeliveryPolicy.cs: 

Update policy to enforce that the zeroth redelivery has no delay, the initial rollback should
not be delayed.

Modified:
    activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/policies/RedeliveryPolicy.cs

Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/policies/RedeliveryPolicy.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/policies/RedeliveryPolicy.cs?rev=831619&r1=831618&r2=831619&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/policies/RedeliveryPolicy.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/policies/RedeliveryPolicy.cs
Sat Oct 31 23:48:04 2009
@@ -65,10 +65,16 @@
         public int RedeliveryDelay(int redeliveredCounter)
         {
             int delay = 0;
+            
+            if(redeliveredCounter == 0)
+            {
+                // The first time through there is no delay, the Rollback should be immediate.
+                return 0;
+            }
 
             if(UseExponentialBackOff && BackOffMultiplier > 1)
             {
-                delay = Convert.ToInt32(initialRedeliveryDelay * (Math.Pow(BackOffMultiplier,
redeliveredCounter)));
+                delay = initialRedeliveryDelay * Convert.ToInt32(Math.Pow(BackOffMultiplier,
redeliveredCounter - 1));
             }
             else
             {



Mime
View raw message