You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2015/09/30 20:53:28 UTC

svn commit: r1706126 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp: Connection.cs Session.cs

Author: tabish
Date: Wed Sep 30 18:53:27 2015
New Revision: 1706126

URL: http://svn.apache.org/viewvc?rev=1706126&view=rev
Log:
https://issues.apache.org/jira/browse/AMQNET-489

Ensure that the lastDeliveredSequenceId gets sent when the ConnectionInfo is sent.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Session.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Connection.cs?rev=1706126&r1=1706125&r2=1706126&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Connection.cs Wed Sep 30 18:53:27 2015
@@ -713,11 +713,13 @@ namespace Apache.NMS.ActiveMQ
                         }
                     }
 
+                    long lastDeliveredSequenceId = -1;
                     lock(sessions.SyncRoot)
                     {
                         foreach(Session session in sessions)
                         {
                             session.Shutdown();
+                            lastDeliveredSequenceId = Math.Max(lastDeliveredSequenceId, session.LastDeliveredSequenceId);
                         }
                     }
                     sessions.Clear();
@@ -740,7 +742,7 @@ namespace Apache.NMS.ActiveMQ
                     // inform the broker of a remove, and if the transport is failed, why bother.
                     if(connected.Value && !transportFailed.Value)
                     {
-                        DisposeOf(ConnectionId);
+                        DisposeOf(ConnectionId, lastDeliveredSequenceId);
                         ShutdownInfo shutdowninfo = new ShutdownInfo();
                         transport.Oneway(shutdowninfo);
                     }
@@ -908,12 +910,14 @@ namespace Apache.NMS.ActiveMQ
             }
         }
 
-        private void DisposeOf(DataStructure objectId)
+        private void DisposeOf(DataStructure objectId, long lastDeliveredSequenceId)
         {
             try
             {
                 RemoveInfo command = new RemoveInfo();
                 command.ObjectId = objectId;
+                command.LastDeliveredSequenceId = lastDeliveredSequenceId;
+
                 if(asyncClose)
                 {
                     Tracer.DebugFormat("Connection[{0}]: Asynchronously disposing of Connection.", this.ConnectionId);

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Session.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Session.cs?rev=1706126&r1=1706125&r2=1706126&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Session.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.7.x/src/main/csharp/Session.cs Wed Sep 30 18:53:27 2015
@@ -305,6 +305,11 @@ namespace Apache.NMS.ActiveMQ
             }
         }
 
+        internal long LastDeliveredSequenceId
+        {
+            get { return this.lastDeliveredSequenceId; }
+        }
+
         #endregion
 
         #region ISession Members