From e2b22676d439ed2f84292056798786b9cdbbb56c Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Sun, 4 Dec 2022 22:36:55 +0700 Subject: [PATCH] separate generate subject name for nats type --- utils.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/utils.go b/utils.go index 16e75b5..5218be5 100644 --- a/utils.go +++ b/utils.go @@ -29,8 +29,14 @@ func combineStreamAndSubjectName(stream, subject string) string { return fmt.Sprintf("%s.%s", stream, subject) } -// GenerateSubject ... -// GenerateSubject("admin", "help_center", "get_ticket_by_id") -func GenerateSubject(server, service, subject string) string { - return fmt.Sprintf("%s.%s.%s.%s", globalConfig.StreamName, server, service, subject) +// GenerateJetStreamSubject ... +// GenerateJetStreamSubject("admin", "help_center", "get_ticket_by_id") +func GenerateJetStreamSubject(server, service, subject string) string { + return fmt.Sprintf("%s.jetstream.%s.%s.%s", globalConfig.StreamName, server, service, subject) +} + +// GenerateReqrepSubject ... +// GenerateReqrepSubject("admin", "help_center", "get_ticket_by_id") +func GenerateReqrepSubject(server, service, subject string) string { + return fmt.Sprintf("%s.reqrep.%s.%s.%s", globalConfig.StreamName, server, service, subject) }