From ea8a11605c0e546232087e75d3c644afa63ddbb6 Mon Sep 17 00:00:00 2001 From: "Jibon L. Costa" Date: Mon, 23 Sep 2024 13:29:07 +0200 Subject: [PATCH] use ephemeral --- pkg/services/nats/js_consumer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/services/nats/js_consumer.go b/pkg/services/nats/js_consumer.go index 774d8390..a5a753e0 100644 --- a/pkg/services/nats/js_consumer.go +++ b/pkg/services/nats/js_consumer.go @@ -8,7 +8,7 @@ import ( func (s *NatsService) CreateChatConsumer(roomId, userId string) (jwt.StringList, error) { _, err := s.js.CreateOrUpdateConsumer(s.ctx, roomId, jetstream.ConsumerConfig{ - Durable: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.Chat, userId), + Name: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.Chat, userId), FilterSubjects: []string{ fmt.Sprintf("%s:%s.>", roomId, s.app.NatsInfo.Subjects.Chat), }, @@ -29,7 +29,7 @@ func (s *NatsService) CreateChatConsumer(roomId, userId string) (jwt.StringList, func (s *NatsService) CreateSystemPublicConsumer(roomId, userId string) (jwt.StringList, error) { _, err := s.js.CreateOrUpdateConsumer(s.ctx, roomId, jetstream.ConsumerConfig{ - Durable: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.SystemPublic, userId), + Name: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.SystemPublic, userId), DeliverPolicy: jetstream.DeliverNewPolicy, FilterSubjects: []string{ fmt.Sprintf("%s:%s.>", roomId, s.app.NatsInfo.Subjects.SystemPublic), @@ -50,7 +50,7 @@ func (s *NatsService) CreateSystemPublicConsumer(roomId, userId string) (jwt.Str func (s *NatsService) CreateSystemPrivateConsumer(roomId, userId string) (jwt.StringList, error) { _, err := s.js.CreateOrUpdateConsumer(s.ctx, roomId, jetstream.ConsumerConfig{ - Durable: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.SystemPrivate, userId), + Name: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.SystemPrivate, userId), DeliverPolicy: jetstream.DeliverNewPolicy, FilterSubjects: []string{ fmt.Sprintf("%s:%s.%s.>", roomId, s.app.NatsInfo.Subjects.SystemPrivate, userId), @@ -71,7 +71,7 @@ func (s *NatsService) CreateSystemPrivateConsumer(roomId, userId string) (jwt.St func (s *NatsService) CreateWhiteboardConsumer(roomId, userId string) (jwt.StringList, error) { _, err := s.js.CreateOrUpdateConsumer(s.ctx, roomId, jetstream.ConsumerConfig{ - Durable: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.Whiteboard, userId), + Name: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.Whiteboard, userId), DeliverPolicy: jetstream.DeliverNewPolicy, FilterSubjects: []string{ fmt.Sprintf("%s:%s.>", roomId, s.app.NatsInfo.Subjects.Whiteboard), @@ -93,7 +93,7 @@ func (s *NatsService) CreateWhiteboardConsumer(roomId, userId string) (jwt.Strin func (s *NatsService) CreateDataChannelConsumer(roomId, userId string) (jwt.StringList, error) { _, err := s.js.CreateOrUpdateConsumer(s.ctx, roomId, jetstream.ConsumerConfig{ - Durable: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.DataChannel, userId), + Name: fmt.Sprintf("%s:%s", s.app.NatsInfo.Subjects.DataChannel, userId), DeliverPolicy: jetstream.DeliverNewPolicy, FilterSubjects: []string{ fmt.Sprintf("%s:%s.>", roomId, s.app.NatsInfo.Subjects.DataChannel),