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 2017/03/08 23:12:40 UTC

[38/50] [abbrv] activemq-nms-openwire git commit: https://issues.apache.org/jira/browse/AMQNET-489

https://issues.apache.org/jira/browse/AMQNET-489

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


Project: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/commit/34770b60
Tree: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/tree/34770b60
Diff: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/diff/34770b60

Branch: refs/heads/master
Commit: 34770b6010c7c4a1d250ec204d1b37652048bef0
Parents: ec37f32
Author: Timothy A. Bish <ta...@apache.org>
Authored: Wed Sep 30 18:55:48 2015 +0000
Committer: Timothy A. Bish <ta...@apache.org>
Committed: Wed Sep 30 18:55:48 2015 +0000

----------------------------------------------------------------------
 src/main/csharp/Connection.cs | 8 ++++++--
 src/main/csharp/Session.cs    | 5 +++++
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/blob/34770b60/src/main/csharp/Connection.cs
----------------------------------------------------------------------
diff --git a/src/main/csharp/Connection.cs b/src/main/csharp/Connection.cs
index 33fb3e8..10832b3 100755
--- a/src/main/csharp/Connection.cs
+++ b/src/main/csharp/Connection.cs
@@ -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);

http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/blob/34770b60/src/main/csharp/Session.cs
----------------------------------------------------------------------
diff --git a/src/main/csharp/Session.cs b/src/main/csharp/Session.cs
index 8fd6db3..ef91700 100755
--- a/src/main/csharp/Session.cs
+++ b/src/main/csharp/Session.cs
@@ -305,6 +305,11 @@ namespace Apache.NMS.ActiveMQ
             }
         }
 
+        internal long LastDeliveredSequenceId
+        {
+            get { return this.lastDeliveredSequenceId; }
+        }
+
         #endregion
 
         #region ISession Members