mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
fix: change consumer group receive messages avoid kafka consumer group always rebalanced. (#1942)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user