mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
mysql storage
This commit is contained in:
parent
d0aa0a8772
commit
37dd079129
@ -39,15 +39,14 @@ func NewPersistentConsumerHandler(database controller.ChatLogDatabase) *Persiste
|
||||
func (pc *PersistentConsumerHandler) handleChatWs2Mysql(ctx context.Context, cMsg *sarama.ConsumerMessage, msgKey string, _ sarama.ConsumerGroupSession) {
|
||||
msg := cMsg.Value
|
||||
operationID := mcontext.GetOperationID(ctx)
|
||||
log.NewInfo("msg come here mysql!!!", "", "msg", string(msg), msgKey)
|
||||
var tag bool
|
||||
msgFromMQ := pbMsg.MsgDataToMQ{}
|
||||
err := proto.Unmarshal(msg, &msgFromMQ)
|
||||
if err != nil {
|
||||
log.NewError(operationID, "msg_transfer Unmarshal msg err", "msg", string(msg), "err", err.Error())
|
||||
log.ZError(ctx, "msg_transfer Unmarshal msg err", err)
|
||||
return
|
||||
}
|
||||
log.Debug(operationID, "proto.Unmarshal MsgDataToMQ", msgFromMQ.String())
|
||||
log.ZDebug(ctx, "handleChatWs2Mysql", "msg", msgFromMQ.MsgData)
|
||||
//Control whether to store history messages (mysql)
|
||||
isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent)
|
||||
//Only process receiver data
|
||||
|
Loading…
x
Reference in New Issue
Block a user