kafka topic优化及解释,删除废弃topic的冗余代码 (#255)

pull/263/head
Smile 2 years ago committed by GitHub
parent c4ee293388
commit 547ad7a2c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,16 +45,16 @@ redis:
kafka: kafka:
ws2mschat: ws2mschat:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可 addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ws2ms_chat" topic: "ws2ms_chat" #用于mongo和mysql保存消息
ws2mschatoffline: # ws2mschatoffline:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可 # addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ws2ms_chat_offline" # topic: "ws2ms_chat_offline" #原为离线用户消息处理,目前暂时弃用
msgtomongo: msgtomongo:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可 addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "msg_to_mongo" topic: "msg_to_mongo"
ms2pschat: ms2pschat:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可 addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ms2ps_chat" topic: "ms2ps_chat" #消息push
consumergroupid: consumergroupid:
msgToTransfer: mongo msgToTransfer: mongo
msgToMongo: mongo_ex msgToMongo: mongo_ex

@ -21,7 +21,7 @@ type rpcChat struct {
etcdSchema string etcdSchema string
etcdAddr []string etcdAddr []string
onlineProducer *kafka.Producer onlineProducer *kafka.Producer
offlineProducer *kafka.Producer //offlineProducer *kafka.Producer
delMsgCh chan deleteMsg delMsgCh chan deleteMsg
} }
@ -41,7 +41,7 @@ func NewRpcChatServer(port int) *rpcChat {
etcdAddr: config.Config.Etcd.EtcdAddr, etcdAddr: config.Config.Etcd.EtcdAddr,
} }
rc.onlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) rc.onlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic)
rc.offlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschatOffline.Addr, config.Config.Kafka.Ws2mschatOffline.Topic) //rc.offlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschatOffline.Addr, config.Config.Kafka.Ws2mschatOffline.Topic)
rc.delMsgCh = make(chan deleteMsg, 1000) rc.delMsgCh = make(chan deleteMsg, 1000)
return &rc return &rc
} }

@ -213,10 +213,10 @@ type config struct {
Addr []string `yaml:"addr"` Addr []string `yaml:"addr"`
Topic string `yaml:"topic"` Topic string `yaml:"topic"`
} }
Ws2mschatOffline struct { //Ws2mschatOffline struct {
Addr []string `yaml:"addr"` // Addr []string `yaml:"addr"`
Topic string `yaml:"topic"` // Topic string `yaml:"topic"`
} //}
MsgToMongo struct { MsgToMongo struct {
Addr []string `yaml:"addr"` Addr []string `yaml:"addr"`
Topic string `yaml:"topic"` Topic string `yaml:"topic"`

Loading…
Cancel
Save