https://issues.apache.org/jira/browse/AMQNET-489
Ensure that the lastDeliveredSequenceId gets sent when the ConnectionInfo is sent.
diff --git a/src/main/csharp/Connection.cs b/src/main/csharp/Connection.cs
index a4a5247..74be66f 100755
--- a/src/main/csharp/Connection.cs
+++ b/src/main/csharp/Connection.cs
@@ -713,11 +713,13 @@
}
}
+ 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 @@
// 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 @@
}
}
- 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);
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 @@
}
}
+ internal long LastDeliveredSequenceId
+ {
+ get { return this.lastDeliveredSequenceId; }
+ }
+
#endregion
#region ISession Members