作者 唐旭辉

提交

... ... @@ -4,6 +4,7 @@ import (
"os"
"github.com/Shopify/sarama"
"github.com/astaxie/beego/logs"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/port/consumer/handles"
)
... ... @@ -12,11 +13,11 @@ type TopicHandle func(*sarama.ConsumerMessage) error
//TopicHandleRouters 根据topic区分消息并进行处理
var TopicHandleRouters = map[string]TopicHandle{
// "topic_test": func(message *sarama.ConsumerMessage) error {
// logs.Info("Done Message claimed: timestamp = %v, topic = %s offset = %v value = %v \n",
// message.Timestamp, message.Topic, message.Offset, string(message.Value))
// return nil
// },
"topic_test": func(message *sarama.ConsumerMessage) error {
logs.Info("Done Message claimed: timestamp = %v, topic = %s offset = %v value = %v \n",
message.Timestamp, message.Topic, message.Offset, string(message.Value))
return nil
},
}
func init() {
... ...