aboutsummaryrefslogtreecommitdiff
path: root/setup/jetstream
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-09-27 15:01:34 +0200
committerGitHub <noreply@github.com>2022-09-27 15:01:34 +0200
commit249b32c4f3ee2e01e6f89435e0c7a5786d2ae3a1 (patch)
tree1fc229f6a4bafa88afd7c1db3eda3ff3a59b021e /setup/jetstream
parentf18bce93cc3e7e5f57ebc55d309360b7f8703553 (diff)
Refactor notifications (#2688)
This PR changes the handling of notifications - removes the `StreamEvent` and `ReadUpdate` stream - listens on the `OutputRoomEvent` stream in the UserAPI to inform the SyncAPI about unread notifications - listens on the `OutputReceiptEvent` stream in the UserAPI to set receipts/update notifications - sets the `read_markers` directly from within the internal UserAPI Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'setup/jetstream')
-rw-r--r--setup/jetstream/nats.go5
-rw-r--r--setup/jetstream/streams.go10
2 files changed, 4 insertions, 11 deletions
diff --git a/setup/jetstream/nats.go b/setup/jetstream/nats.go
index 3660e91e..7409fd6c 100644
--- a/setup/jetstream/nats.go
+++ b/setup/jetstream/nats.go
@@ -9,9 +9,10 @@ import (
"time"
"github.com/getsentry/sentry-go"
+ "github.com/sirupsen/logrus"
+
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/setup/process"
- "github.com/sirupsen/logrus"
natsserver "github.com/nats-io/nats-server/v2/server"
natsclient "github.com/nats-io/nats.go"
@@ -184,6 +185,8 @@ func setupNATS(process *process.ProcessContext, cfg *config.JetStream, nc *natsc
OutputSendToDeviceEvent: {"SyncAPIEDUServerSendToDeviceConsumer", "FederationAPIEDUServerConsumer"},
OutputTypingEvent: {"SyncAPIEDUServerTypingConsumer", "FederationAPIEDUServerConsumer"},
OutputRoomEvent: {"AppserviceRoomserverConsumer"},
+ OutputStreamEvent: {"UserAPISyncAPIStreamEventConsumer"},
+ OutputReadUpdate: {"UserAPISyncAPIReadUpdateConsumer"},
} {
streamName := cfg.Matrix.JetStream.Prefixed(stream)
for _, consumer := range consumers {
diff --git a/setup/jetstream/streams.go b/setup/jetstream/streams.go
index c07d3a0b..ee9810da 100644
--- a/setup/jetstream/streams.go
+++ b/setup/jetstream/streams.go
@@ -95,16 +95,6 @@ var streams = []*nats.StreamConfig{
Storage: nats.FileStorage,
},
{
- Name: OutputStreamEvent,
- Retention: nats.InterestPolicy,
- Storage: nats.FileStorage,
- },
- {
- Name: OutputReadUpdate,
- Retention: nats.InterestPolicy,
- Storage: nats.FileStorage,
- },
- {
Name: OutputPresenceEvent,
Retention: nats.InterestPolicy,
Storage: nats.MemoryStorage,