Commit fe838580 authored by xiaoguang.xu's avatar xiaoguang.xu

使用enoch-group作为consumer group

parent 15914174
...@@ -14,7 +14,7 @@ import ( ...@@ -14,7 +14,7 @@ import (
var ( var (
brokers = []string{"172.30.12.19:9092", "172.30.12.20:9092", "172.30.12.21:9092"} brokers = []string{"172.30.12.19:9092", "172.30.12.20:9092", "172.30.12.21:9092"}
kafkaTopic = "quantGroup.tech.brave.pro" kafkaTopic = "quantGroup.tech.brave.pro"
kafkaGroup = "another-group-test" kafkaGroup = "enoch-group"
) )
type exampleConsumerGroupHandler struct{} type exampleConsumerGroupHandler struct{}
...@@ -65,7 +65,6 @@ func ClusterConsumer() { ...@@ -65,7 +65,6 @@ func ClusterConsumer() {
case msg, ok := <-consumer.Messages(): case msg, ok := <-consumer.Messages():
if ok { if ok {
//fmt.Fprintf(os.Stdout, "%s/%d/%d\t%s\t%s\n", msg.Topic, msg.Partition, msg.Offset, msg.Key, msg.Value) //fmt.Fprintf(os.Stdout, "%s/%d/%d\t%s\t%s\n", msg.Topic, msg.Partition, msg.Offset, msg.Key, msg.Value)
//fmt.Println(msg.Offset)
MsgProcess(string(msg.Value)) MsgProcess(string(msg.Value))
consumer.MarkOffset(msg, "") // mark message as processed consumer.MarkOffset(msg, "") // mark message as processed
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment