activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r1375295 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp: Connection.cs Transport/Failover/FailoverTransport.cs
Date Mon, 20 Aug 2012 22:59:17 GMT
Author: jgomes
Date: Mon Aug 20 22:59:17 2012
New Revision: 1375295

URL: http://svn.apache.org/viewvc?rev=1375295&view=rev
Log:
Reimplement fix for zombie consumers to update the failover state tracker.
Fixes https://issues.apache.org/jira/browse/AMQNET-394

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs?rev=1375295&r1=1375294&r2=1375295&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs
Mon Aug 20 22:59:17 2012
@@ -907,8 +907,7 @@ namespace Apache.NMS.ActiveMQ
                 }
             }
 
-            Tracer.ErrorFormat("Connection[{0}]: No such consumer active: {1}.  Removing...",
this.ConnectionId, dispatch.ConsumerId);
-            transport.Oneway(new RemoveInfo() { ObjectId = dispatch.ConsumerId });
+            Tracer.ErrorFormat("Connection[{0}]: No such consumer active: {1}", this.ConnectionId,
dispatch.ConsumerId);
         }
 
         protected void OnKeepAliveCommand(ITransport commandTransport, KeepAliveInfo info)

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs?rev=1375295&r1=1375294&r2=1375295&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs
Mon Aug 20 22:59:17 2012
@@ -563,7 +563,8 @@ namespace Apache.NMS.ActiveMQ.Transport.
                         return;
                     }
                     else if(command.IsRemoveInfo || command.IsMessageAck)
-                    {
+                    {
+                        stateTracker.Track(command);
                         // Simulate response to RemoveInfo command or a MessageAck
                         // since it would be stale at this point.
                         if(command.ResponseRequired)
@@ -596,23 +597,23 @@ namespace Apache.NMS.ActiveMQ.Transport.
                         // Wait for transport to be connected.
                         ITransport transport = ConnectedTransport;
                         DateTime start = DateTime.Now;
-                        bool timedout = false;
+                        bool timedout = false;
                         while(transport == null && !disposed && connectionFailure
== null)
                         {
                             Tracer.Info("Waiting for transport to reconnect.");
 
                             int elapsed = (int) (DateTime.Now - start).TotalMilliseconds;
-                            if(this.timeout > 0 && elapsed > timeout)
+                            if(this.timeout > 0 && elapsed > this.timeout)
                             {
                                 timedout = true;
                                 Tracer.DebugFormat("FailoverTransport.oneway - timed out
after {0} mills", elapsed);
                                 break;
-                            }
-
+                            }
+
                             // Release so that the reconnect task can run
                             try
                             {
-                                // Wait for something
+                                // Wait for something.  The mutex will be pulsed if we connect.
                                 Monitor.Wait(reconnectMutex, 100);
                             }
                             catch(ThreadInterruptedException e)



Mime
View raw message