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
|
@ -2,6 +2,8 @@ package config
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
type JetStream struct {
|
||||
|
@ -23,6 +25,10 @@ func (c *JetStream) TopicFor(name string) string {
|
|||
return fmt.Sprintf("%s%s", c.TopicPrefix, name)
|
||||
}
|
||||
|
||||
func (c *JetStream) Durable(name string) nats.SubOpt {
|
||||
return nats.Durable(c.TopicFor(name))
|
||||
}
|
||||
|
||||
func (c *JetStream) Defaults(generate bool) {
|
||||
c.Addresses = []string{}
|
||||
c.TopicPrefix = "Dendrite"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue