You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by xi...@apache.org on 2023/09/01 08:03:54 UTC
[pulsar-client-go] 01/01: [improve][client] Implement GetLastMSgID for Reader
This is an automated email from the ASF dual-hosted git repository.
xiangying pushed a commit to branch reader-last-msgID
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git
commit 06feb849915cc933002e03c588d7ba87fc755705
Author: xiangying <19...@qq.com>
AuthorDate: Fri Sep 1 16:03:05 2023 +0800
[improve][client] Implement GetLastMSgID for Reader
---
pulsar/reader.go | 3 +++
pulsar/reader_impl.go | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/pulsar/reader.go b/pulsar/reader.go
index d58d06f6..d4d1762e 100644
--- a/pulsar/reader.go
+++ b/pulsar/reader.go
@@ -134,4 +134,7 @@ type Reader interface {
// the message publish time where to reposition the subscription
//
SeekByTime(time time.Time) error
+
+ // GetLastMSgID get the last message id available for consume.
+ GetLastMSgID() (MessageID, error)
}
diff --git a/pulsar/reader_impl.go b/pulsar/reader_impl.go
index 5a2128a3..0ebd8578 100644
--- a/pulsar/reader_impl.go
+++ b/pulsar/reader_impl.go
@@ -244,3 +244,7 @@ func (r *reader) SeekByTime(time time.Time) error {
return r.pc.SeekByTime(time)
}
+
+func (r *reader) GetLastMSgID() (MessageID, error) {
+ return r.pc.getLastMessageID()
+}