diff --git a/pkg/services/nats/js_consumer.go b/pkg/services/nats/js_consumer.go index 4aa6fbcb..a5a753e0 100644 --- a/pkg/services/nats/js_consumer.go +++ b/pkg/services/nats/js_consumer.go @@ -50,7 +50,8 @@ 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{ - Name: 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), },