mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
NATS JetStream tweaks (#2086)
* Use named NATS durable consumers * Build fixes * Remove dupe call to SetFederationAPI * Use namespaced consumer name * Fix namespacing * Fix unit tests hopefully
This commit is contained in:
parent
a422321435
commit
16035b9737
14 changed files with 51 additions and 15 deletions
|
@ -67,6 +67,7 @@ func NewRoomserverAPI(
|
|||
InputRoomEventTopic: inputRoomEventTopic,
|
||||
OutputRoomEventTopic: outputRoomEventTopic,
|
||||
JetStream: consumer,
|
||||
Durable: cfg.Matrix.JetStream.Durable("RoomserverInputConsumer"),
|
||||
ServerName: cfg.Matrix.ServerName,
|
||||
ACLs: serverACLs,
|
||||
},
|
||||
|
|
|
@ -43,6 +43,7 @@ var keyContentFields = map[string]string{
|
|||
type Inputer struct {
|
||||
DB storage.Database
|
||||
JetStream nats.JetStreamContext
|
||||
Durable nats.SubOpt
|
||||
ServerName gomatrixserverlib.ServerName
|
||||
ACLs *acls.ServerACLs
|
||||
InputRoomEventTopic string
|
||||
|
@ -85,6 +86,8 @@ func (r *Inputer) Start() error {
|
|||
// or nak them within a certain amount of time. This stops that from
|
||||
// happening, so we don't end up doing a lot of unnecessary duplicate work.
|
||||
nats.MaxDeliver(0),
|
||||
// Use a durable named consumer.
|
||||
r.Durable,
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue