mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-16 14:59:01 +08:00
msg update
This commit is contained in:
@@ -9,7 +9,7 @@ package kafka
|
||||
import (
|
||||
"context"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tracelog"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext"
|
||||
"github.com/Shopify/sarama"
|
||||
)
|
||||
|
||||
@@ -43,14 +43,14 @@ func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addrs []str
|
||||
}
|
||||
|
||||
func (mc *MConsumerGroup) GetContextFromMsg(cMsg *sarama.ConsumerMessage, rootFuncName string) context.Context {
|
||||
ctx := tracelog.NewCtx(rootFuncName)
|
||||
ctx := mcontext.NewCtx(rootFuncName)
|
||||
var operationID string
|
||||
for _, v := range cMsg.Headers {
|
||||
if string(v.Key) == constant.OperationID {
|
||||
operationID = string(v.Value)
|
||||
}
|
||||
}
|
||||
tracelog.SetOperationID(ctx, operationID)
|
||||
mcontext.SetOperationID(ctx, operationID)
|
||||
return ctx
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user