feat: use names for connections to the nats event bus

This commit is contained in:
Juan Pablo Villafáñez
2025-09-08 17:32:35 +02:00
committed by Jörn Friedrich Dreyer
parent df10de7498
commit ca2dc823ef
18 changed files with 91 additions and 19 deletions
+3 -1
View File
@@ -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,