From e21251f8605c81fa495a370b900e15062c4e2a7e Mon Sep 17 00:00:00 2001 From: Gabriele Santomaggio Date: Wed, 29 May 2024 09:32:32 +0200 Subject: [PATCH] change the default value for last_stored_offset (#307) fixes:https://github.com/rabbitmq/rabbitmq-stream-go-client/issues/306 Signed-off-by: Gabriele Santomaggio --- .gitignore | 1 + pkg/stream/coordinator.go | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 480d74be..524a7254 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ dist/ perfTest/perfTest go.dev/ +local_ex/ diff --git a/pkg/stream/coordinator.go b/pkg/stream/coordinator.go index d1b8098f..97647763 100644 --- a/pkg/stream/coordinator.go +++ b/pkg/stream/coordinator.go @@ -202,6 +202,7 @@ func (coordinator *Coordinator) NewConsumer(messagesHandler MessagesHandler, status: open, mutex: &sync.Mutex{}, MessagesHandler: messagesHandler, + lastStoredOffset: -1, // because 0 is a valid value for the offset isPromotedAsActive: true, }