diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-10-15 13:27:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-15 13:27:13 +0100 |
commit | 49abe359e6a2b0c3f214190b73404c5cf9a0e051 (patch) | |
tree | ade4613526d0f6a306cd7117c8f77ab30b151ea0 /syncapi | |
parent | 10f1beb0de7a52ccdd122b05b4adffdbdab4ea2e (diff) |
Start Kafka connections for each component that needs them (#1527)
* Start Kafka connection for each component that needs one
* Fix roomserver unit tests
* Rename to naffkaInstance (@Kegsay review comment)
* Fix import cycle
Diffstat (limited to 'syncapi')
-rw-r--r-- | syncapi/syncapi.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/syncapi/syncapi.go b/syncapi/syncapi.go index 43e2455b..de0bb434 100644 --- a/syncapi/syncapi.go +++ b/syncapi/syncapi.go @@ -17,11 +17,11 @@ package syncapi import ( "context" - "github.com/Shopify/sarama" "github.com/gorilla/mux" "github.com/sirupsen/logrus" "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/internal/setup/kafka" keyapi "github.com/matrix-org/dendrite/keyserver/api" "github.com/matrix-org/dendrite/roomserver/api" userapi "github.com/matrix-org/dendrite/userapi/api" @@ -37,13 +37,14 @@ import ( // component. func AddPublicRoutes( router *mux.Router, - consumer sarama.Consumer, userAPI userapi.UserInternalAPI, rsAPI api.RoomserverInternalAPI, keyAPI keyapi.KeyInternalAPI, federation *gomatrixserverlib.FederationClient, cfg *config.SyncAPI, ) { + consumer, _ := kafka.SetupConsumerProducer(&cfg.Matrix.Kafka) + syncDB, err := storage.NewSyncServerDatasource(&cfg.Database) if err != nil { logrus.WithError(err).Panicf("failed to connect to sync db") |