From b883cd8a7efd599e0725cee45828a07d2536ccc4 Mon Sep 17 00:00:00 2001 From: xuegangjie <631126217@qq.com> Date: Fri, 5 Aug 2022 20:55:14 +0800 Subject: [PATCH] [feat] fix query not found --- consumer/offset_store.go | 5 +++++ internal/response.go | 1 + 2 files changed, 6 insertions(+) diff --git a/consumer/offset_store.go b/consumer/offset_store.go index 86ecd187..83639b8b 100644 --- a/consumer/offset_store.go +++ b/consumer/offset_store.go @@ -372,6 +372,11 @@ func (r *remoteBrokerOffsetStore) fetchConsumeOffsetFromBroker(group string, mq if err != nil { return -1, err } + + if res.Code == internal.ResQueryNotFount { + return -1, nil + } + if res.Code != internal.ResSuccess { return -2, fmt.Errorf("broker response code: %d, remarks: %s", res.Code, res.Remark) } diff --git a/internal/response.go b/internal/response.go index ae75b9c9..4ead63a3 100644 --- a/internal/response.go +++ b/internal/response.go @@ -27,6 +27,7 @@ const ( ResPullNotFound = int16(19) ResPullRetryImmediately = int16(20) ResPullOffsetMoved = int16(21) + ResQueryNotFount = int16(22) ) type SendMessageResponse struct {