mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 11:06:43 +08:00
msg transfer handle change
This commit is contained in:
parent
8e3f090ffe
commit
573937e1e5
@ -38,6 +38,7 @@ func Init() {
|
|||||||
w = new(sync.Mutex)
|
w = new(sync.Mutex)
|
||||||
persistentCH.Init()
|
persistentCH.Init()
|
||||||
historyCH.Init(cmdCh)
|
historyCH.Init(cmdCh)
|
||||||
|
historyMongoCH.Init()
|
||||||
onlineTopicStatus = OnlineTopicVacancy
|
onlineTopicStatus = OnlineTopicVacancy
|
||||||
//offlineHistoryCH.Init(cmdCh)
|
//offlineHistoryCH.Init(cmdCh)
|
||||||
statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval)
|
statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval)
|
||||||
@ -53,7 +54,7 @@ func Run() {
|
|||||||
fmt.Println("not start mysql consumer")
|
fmt.Println("not start mysql consumer")
|
||||||
}
|
}
|
||||||
go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH)
|
go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH)
|
||||||
//go historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyMongoCH)
|
go historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyMongoCH)
|
||||||
//go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH)
|
//go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH)
|
||||||
}
|
}
|
||||||
func SetOnlineTopicStatus(status int) {
|
func SetOnlineTopicStatus(status int) {
|
||||||
|
@ -18,7 +18,7 @@ type OnlineHistoryMongoConsumerHandler struct {
|
|||||||
historyConsumerGroup *kfk.MConsumerGroup
|
historyConsumerGroup *kfk.MConsumerGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
func (och *OnlineHistoryMongoConsumerHandler) Init(cmdCh chan Cmd2Value) {
|
func (och *OnlineHistoryMongoConsumerHandler) Init() {
|
||||||
och.msgHandle = make(map[string]fcb)
|
och.msgHandle = make(map[string]fcb)
|
||||||
och.msgHandle[config.Config.Kafka.MsgToMongo.Topic] = och.handleChatWs2Mongo
|
och.msgHandle[config.Config.Kafka.MsgToMongo.Topic] = och.handleChatWs2Mongo
|
||||||
och.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0,
|
och.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user