feat: use names for connections to the nats event bus
This commit is contained in:
committed by
Jörn Friedrich Dreyer
parent
df10de7498
commit
ca2dc823ef
@@ -1,6 +1,7 @@
|
||||
package event
|
||||
|
||||
import (
|
||||
"github.com/opencloud-eu/opencloud/pkg/generators"
|
||||
"github.com/opencloud-eu/opencloud/services/storage-users/pkg/config"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/events/stream"
|
||||
"go-micro.dev/v4/events"
|
||||
@@ -8,7 +9,8 @@ import (
|
||||
|
||||
// NewStream prepares the requested nats stream and returns it.
|
||||
func NewStream(cfg *config.Config) (events.Stream, error) {
|
||||
return stream.NatsFromConfig(cfg.Service.Name, false, stream.NatsConfig{
|
||||
connName := generators.GenerateConnectionName(cfg.Service.Name, generators.NTYPE_BUS)
|
||||
return stream.NatsFromConfig(connName, false, stream.NatsConfig{
|
||||
Endpoint: cfg.Events.Addr,
|
||||
Cluster: cfg.Events.ClusterID,
|
||||
EnableTLS: cfg.Events.EnableTLS,
|
||||
|
||||
Reference in New Issue
Block a user