// Copyright (C) 2020 Finogeeks Co., Ltd // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License, version 3, // as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . package entry import ( "github.com/finogeeks/ligase/common" "github.com/finogeeks/ligase/common/basecomponent" "github.com/finogeeks/ligase/common/uid" "github.com/finogeeks/ligase/pushsender" ) func StartPushSender(base *basecomponent.BaseDendrite, cmd *serverCmdPar) { transportMultiplexer := common.GetTransportMultiplexer() kafka := base.Cfg.Kafka addProducer(transportMultiplexer, kafka.Producer.DBUpdates) for _, v := range dbUpdateProducerName { dbUpdates := kafka.Producer.DBUpdates dbUpdates.Topic = dbUpdates.Topic + "_" + v dbUpdates.Name = dbUpdates.Name + "_" + v addProducer(transportMultiplexer, dbUpdates) } transportMultiplexer.PreStart() idg, _ := uid.NewDefaultIdGenerator(base.Cfg.Matrix.InstanceId) rpcClient := common.NewRpcClient(base.Cfg.Nats.Uri, idg) rpcClient.Start(false) pushsender.SetupPushSenderComponent(base, rpcClient) }