fix: change consumer group receive messages avoid kafka consumer group always rebalanced. (#1942)

This commit is contained in:
OpenIM-Gordon
2024-02-27 16:44:51 +08:00
committed by GitHub
parent 6c4334b730
commit 8e6c1d74c7
4 changed files with 10 additions and 20 deletions
+2 -7
View File
@@ -20,8 +20,6 @@ import (
"fmt"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/tools/log"
util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil"
"net/http"
@@ -118,11 +116,8 @@ func (m *MsgTransfer) Start(prometheusPort int) error {
netErr error
)
onError := func(ctx context.Context, err error, errInfo string) {
log.ZWarn(ctx, errInfo, err)
}
go m.historyCH.historyConsumerGroup.RegisterHandleAndConsumer(m.ctx, m.historyCH, onError)
go m.historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(m.ctx, m.historyMongoCH, onError)
go m.historyCH.historyConsumerGroup.RegisterHandleAndConsumer(m.ctx, m.historyCH)
go m.historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(m.ctx, m.historyMongoCH)
if config.Config.Prometheus.Enable {
go func() {
@@ -438,6 +438,7 @@ func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(
wg = sync.WaitGroup{}
running = new(atomic.Bool)
)
running.Store(true)
wg.Add(1)
go func() {