diff --git a/RabbitMQ.Stream.Client/StreamStats.cs b/RabbitMQ.Stream.Client/StreamStats.cs
index e96b5619..934c63be 100644
--- a/RabbitMQ.Stream.Client/StreamStats.cs
+++ b/RabbitMQ.Stream.Client/StreamStats.cs
@@ -2,6 +2,7 @@
// 2.0, and the Mozilla Public License, version 2.0.
// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+using System;
using System.Collections.Generic;
namespace RabbitMQ.Stream.Client;
@@ -29,12 +30,7 @@ public ulong FirstOffset()
return (ulong)r;
}
- ///
- /// The last offset in the stream.
- ///
- /// return last offset in the stream
- /// throws NoOffsetException if there is no first offset yet
- ///
+ [Obsolete("LastOffset() is deprecated, please use CommittedChunkId instead.")]
public ulong LastOffset()
{
var r = _statistics.TryGetValue("last_chunk_id", out var value) ? value : -1;
diff --git a/Tests/SystemTests.cs b/Tests/SystemTests.cs
index 46138b49..b22e6419 100644
--- a/Tests/SystemTests.cs
+++ b/Tests/SystemTests.cs
@@ -126,9 +126,6 @@ public async void StreamStatus()
Assert.Throws(() => { stats.FirstOffset(); }
);
- Assert.Throws(() => { stats.LastOffset(); }
- );
-
Assert.Throws(() => { stats.CommittedChunkId(); }
);
@@ -136,7 +133,6 @@ public async void StreamStatus()
SystemUtils.Wait();
var statAfter = await system.StreamStats(stream);
Assert.Equal((ulong)0, statAfter.FirstOffset());
- Assert.True(statAfter.LastOffset() > 0);
Assert.True(statAfter.CommittedChunkId() > 0);
await SystemUtils.CleanUpStreamSystem(system, stream);
}
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index e97b21c0..5f563522 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -1,42 +1,42 @@
-
-
-
- false
- true
- Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term Broadcom refers to Broadcom Inc. and/or its subsidiaries.
- Broadcom
- Broadcom Inc. and/or its subsidiaries.
- net6.0;net7.0;net8.0
-
-
-
-
-
-
-
-
-
-
- runtime; build; native; contentfiles; analyzers; buildtransitive
- all
-
-
-
- runtime; build; native; contentfiles; analyzers; buildtransitive
- all
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ false
+ true
+ Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term Broadcom refers to Broadcom Inc. and/or its subsidiaries.
+ Broadcom
+ Broadcom Inc. and/or its subsidiaries.
+ net6.0;net7.0;net8.0
+
+
+
+
+
+
+
+
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/asciidoc/query-stream.adoc b/docs/asciidoc/query-stream.adoc
index e1efb943..ca4d09b5 100644
--- a/docs/asciidoc/query-stream.adoc
+++ b/docs/asciidoc/query-stream.adoc
@@ -29,8 +29,6 @@ The following methods are available:
- `FirstOffset()`: first offset in the stream
-- `LastOffset()`: last offset in the stream
-
- `CommittedChunkId()`: the ID (offset) of the committed chunk (block of messages) in the stream.
It is the offset of the first message in the last chunk confirmed by a quorum of the stream cluster members (leader and replicas).