separate generate subject name for nats type

This commit is contained in:
Nam Huynh 2022-12-04 22:36:55 +07:00
parent 8321743717
commit e2b22676d4
1 changed files with 10 additions and 4 deletions

View File

@ -29,8 +29,14 @@ func combineStreamAndSubjectName(stream, subject string) string {
return fmt.Sprintf("%s.%s", stream, subject) return fmt.Sprintf("%s.%s", stream, subject)
} }
// GenerateSubject ... // GenerateJetStreamSubject ...
// GenerateSubject("admin", "help_center", "get_ticket_by_id") // GenerateJetStreamSubject("admin", "help_center", "get_ticket_by_id")
func GenerateSubject(server, service, subject string) string { func GenerateJetStreamSubject(server, service, subject string) string {
return fmt.Sprintf("%s.%s.%s.%s", globalConfig.StreamName, server, service, subject) 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)
} }