From 547ad7a2c7315bda341569df12aec4a63112a033 Mon Sep 17 00:00:00 2001 From: Smile <1494445739@qq.com> Date: Thu, 11 Aug 2022 10:24:37 +0800 Subject: [PATCH] =?UTF-8?q?kafka=20topic=E4=BC=98=E5=8C=96=E5=8F=8A?= =?UTF-8?q?=E8=A7=A3=E9=87=8A=EF=BC=8C=E5=88=A0=E9=99=A4=E5=BA=9F=E5=BC=83?= =?UTF-8?q?topic=E7=9A=84=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81=20(#255)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.yaml | 10 +++++----- internal/rpc/msg/rpcChat.go | 6 +++--- pkg/common/config/config.go | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 1eb0122ce..d5655953c 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -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 diff --git a/internal/rpc/msg/rpcChat.go b/internal/rpc/msg/rpcChat.go index d7fde26f3..95f0ceaa5 100644 --- a/internal/rpc/msg/rpcChat.go +++ b/internal/rpc/msg/rpcChat.go @@ -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 } diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 6addffc22..acade2fd2 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -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"`