|
@@ -4,7 +4,6 @@ import ( |
|
@@ -4,7 +4,6 @@ import ( |
|
4
|
"os"
|
4
|
"os"
|
|
5
|
|
5
|
|
|
6
|
"github.com/Shopify/sarama"
|
6
|
"github.com/Shopify/sarama"
|
|
7
|
- "github.com/astaxie/beego/logs"
|
|
|
|
8
|
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/port/consumer/handles"
|
7
|
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/port/consumer/handles"
|
|
9
|
)
|
8
|
)
|
|
10
|
|
9
|
|
|
@@ -13,11 +12,11 @@ type TopicHandle func(*sarama.ConsumerMessage) error |
|
@@ -13,11 +12,11 @@ type TopicHandle func(*sarama.ConsumerMessage) error |
|
13
|
|
12
|
|
|
14
|
//TopicHandleRouters 根据topic区分消息并进行处理
|
13
|
//TopicHandleRouters 根据topic区分消息并进行处理
|
|
15
|
var TopicHandleRouters = map[string]TopicHandle{
|
14
|
var TopicHandleRouters = map[string]TopicHandle{
|
|
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
|
- },
|
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
|
+ // },
|
|
21
|
}
|
20
|
}
|
|
22
|
|
21
|
|
|
23
|
func init() {
|
22
|
func init() {
|