msg update

This commit is contained in:
Gordon
2023-03-22 19:24:38 +08:00
parent 2b0e0eb9e5
commit 19b8bd0ff6
5 changed files with 7 additions and 16 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ func (mmc *ModifyMsgConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSessi
for msg := range claim.Messages() {
log.NewDebug("", "kafka get info to mysql", "ModifyMsgConsumerHandler", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value), "key", string(msg.Key))
if len(msg.Value) != 0 {
ctx := mmc.modifyMsgConsumerGroup.GetContextFromMsg(msg, "modify consumer")
ctx := mmc.modifyMsgConsumerGroup.GetContextFromMsg(msg)
mmc.ModifyMsg(ctx, msg, string(msg.Key), sess)
} else {
log.Error("", "msg get from kafka but is nil", msg.Key)
@@ -78,7 +78,7 @@ func (mc *OnlineHistoryMongoConsumerHandler) ConsumeClaim(sess sarama.ConsumerGr
for msg := range claim.Messages() {
log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value), "key", string(msg.Key))
if len(msg.Value) != 0 {
ctx := mc.historyConsumerGroup.GetContextFromMsg(msg, "mongoDB consumer")
ctx := mc.historyConsumerGroup.GetContextFromMsg(msg)
mc.handleChatWs2Mongo(ctx, msg, string(msg.Key), sess)
} else {
log.Error("", "mongo msg get from kafka but is nil", msg.Key)
@@ -78,7 +78,7 @@ func (pc *PersistentConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSessi
for msg := range claim.Messages() {
log.NewDebug("", "kafka get info to mysql", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value), "key", string(msg.Key))
if len(msg.Value) != 0 {
ctx := pc.persistentConsumerGroup.GetContextFromMsg(msg, "mysql consumer")
ctx := pc.persistentConsumerGroup.GetContextFromMsg(msg)
pc.handleChatWs2Mysql(ctx, msg, string(msg.Key), sess)
} else {
log.Error("", "msg get from kafka but is nil", msg.Key)
+1 -1
View File
@@ -58,7 +58,7 @@ func (ConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil
func (c *ConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession,
claim sarama.ConsumerGroupClaim) error {
for msg := range claim.Messages() {
ctx := c.pushConsumerGroup.GetContextFromMsg(msg, "push consumer")
ctx := c.pushConsumerGroup.GetContextFromMsg(msg)
c.handleMs2PsChat(ctx, msg.Value)
sess.MarkMessage(msg, "")
}