正在显示
1 个修改的文件
包含
6 行增加
和
5 行删除
@@ -4,6 +4,7 @@ import ( | @@ -4,6 +4,7 @@ import ( | ||
4 | "os" | 4 | "os" |
5 | 5 | ||
6 | "github.com/Shopify/sarama" | 6 | "github.com/Shopify/sarama" |
7 | + "github.com/astaxie/beego/logs" | ||
7 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/port/consumer/handles" | 8 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/port/consumer/handles" |
8 | ) | 9 | ) |
9 | 10 | ||
@@ -12,11 +13,11 @@ type TopicHandle func(*sarama.ConsumerMessage) error | @@ -12,11 +13,11 @@ type TopicHandle func(*sarama.ConsumerMessage) error | ||
12 | 13 | ||
13 | //TopicHandleRouters 根据topic区分消息并进行处理 | 14 | //TopicHandleRouters 根据topic区分消息并进行处理 |
14 | var TopicHandleRouters = map[string]TopicHandle{ | 15 | var TopicHandleRouters = map[string]TopicHandle{ |
15 | - // "topic_test": func(message *sarama.ConsumerMessage) error { | ||
16 | - // logs.Info("Done Message claimed: timestamp = %v, topic = %s offset = %v value = %v \n", | ||
17 | - // message.Timestamp, message.Topic, message.Offset, string(message.Value)) | ||
18 | - // return nil | ||
19 | - // }, | 16 | + "topic_test": func(message *sarama.ConsumerMessage) error { |
17 | + logs.Info("Done Message claimed: timestamp = %v, topic = %s offset = %v value = %v \n", | ||
18 | + message.Timestamp, message.Topic, message.Offset, string(message.Value)) | ||
19 | + return nil | ||
20 | + }, | ||
20 | } | 21 | } |
21 | 22 | ||
22 | func init() { | 23 | func init() { |
-
请 注册 或 登录 后发表评论