This commit is contained in:
Gordon
2022-06-08 17:11:17 +08:00
parent 731263638b
commit d587d14f86
2 changed files with 6 additions and 2 deletions
@@ -72,7 +72,9 @@ func (pc *PersistentConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSessi
claim sarama.ConsumerGroupClaim) error {
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))
pc.msgHandle[msg.Topic](msg, string(msg.Key), sess)
if len(msg.Value) != 0 {
pc.msgHandle[msg.Topic](msg, string(msg.Key), sess)
}
sess.MarkMessage(msg, "")
}
return nil