diff --git a/utils.go b/utils.go index e6930bf..2f49fb1 100644 --- a/utils.go +++ b/utils.go @@ -3,6 +3,7 @@ package natsio import ( "encoding/json" "fmt" + "strings" "github.com/thoas/go-funk" ) @@ -30,6 +31,10 @@ func GenerateReqrepSubject(stream, server, subject string) string { return fmt.Sprintf("%s.reqrep.%s.%s", stream, server, subject) } +func GenerateQueueNameFromSubject(subject string) string { + return strings.ReplaceAll(subject, ".", "_") +} + // InterfaceToBytes ... func InterfaceToBytes(data interface{}) []byte { b, err := json.Marshal(data)