diff options
Diffstat (limited to 'publicroomsapi/publicroomsapi.go')
-rw-r--r-- | publicroomsapi/publicroomsapi.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/publicroomsapi/publicroomsapi.go b/publicroomsapi/publicroomsapi.go index cf9ac00e..181966d3 100644 --- a/publicroomsapi/publicroomsapi.go +++ b/publicroomsapi/publicroomsapi.go @@ -17,8 +17,10 @@ package publicroomsapi import ( "github.com/matrix-org/dendrite/clientapi/auth/storage/devices" "github.com/matrix-org/dendrite/common/basecomponent" + "github.com/matrix-org/dendrite/publicroomsapi/consumers" "github.com/matrix-org/dendrite/publicroomsapi/routing" "github.com/matrix-org/dendrite/publicroomsapi/storage" + roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" "github.com/sirupsen/logrus" ) @@ -27,11 +29,19 @@ import ( func SetupPublicRoomsAPIComponent( base *basecomponent.BaseDendrite, deviceDB *devices.Database, + rsQueryAPI roomserverAPI.RoomserverQueryAPI, ) { publicRoomsDB, err := storage.NewPublicRoomsServerDatabase(string(base.Cfg.Database.PublicRoomsAPI)) if err != nil { logrus.WithError(err).Panicf("failed to connect to public rooms db") } + rsConsumer := consumers.NewOutputRoomEventConsumer( + base.Cfg, base.KafkaConsumer, publicRoomsDB, rsQueryAPI, + ) + if err = rsConsumer.Start(); err != nil { + logrus.WithError(err).Panic("failed to start public rooms server consumer") + } + routing.Setup(base.APIMux, deviceDB, publicRoomsDB) } |