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

@ -21,8 +21,8 @@ type rpcChat struct {
etcdSchema string
etcdAddr []string
onlineProducer *kafka.Producer
offlineProducer *kafka.Producer
delMsgCh chan deleteMsg
//offlineProducer *kafka.Producer
delMsgCh chan deleteMsg
}
type deleteMsg struct {
@ -41,7 +41,7 @@ func NewRpcChatServer(port int) *rpcChat {
etcdAddr: config.Config.Etcd.EtcdAddr,
}
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)
return &rc
}

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

Loading…
Cancel
Save