|
|
|
@ -34,7 +34,7 @@ func (pc *PersistentConsumerHandler) Init() {
|
|
|
|
|
|
|
|
|
|
func (pc *PersistentConsumerHandler) handleChatWs2Mysql(cMsg *sarama.ConsumerMessage, msgKey string, _ sarama.ConsumerGroupSession) {
|
|
|
|
|
msg := cMsg.Value
|
|
|
|
|
log.NewInfo("msg come here mysql!!!", "", "msg", string(msg))
|
|
|
|
|
log.NewInfo("msg come here mysql!!!", "", "msg", string(msg), msgKey)
|
|
|
|
|
var tag bool
|
|
|
|
|
msgFromMQ := pbMsg.MsgDataToMQ{}
|
|
|
|
|
err := proto.Unmarshal(msg, &msgFromMQ)
|
|
|
|
@ -71,7 +71,7 @@ func (PersistentConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error {
|
|
|
|
|
func (pc *PersistentConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession,
|
|
|
|
|
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))
|
|
|
|
|
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)
|
|
|
|
|
sess.MarkMessage(msg, "")
|
|
|
|
|
}
|
|
|
|
|