From fed719aed18348837cb53f1402cdcdd4da6b3212 Mon Sep 17 00:00:00 2001 From: Byron Ruth Date: Fri, 29 Jul 2022 08:46:12 -0400 Subject: [PATCH 1/2] Use consumer name in subject for ephemeral --- js.go | 1 + 1 file changed, 1 insertion(+) diff --git a/js.go b/js.go index d9df981d8..256d4d001 100644 --- a/js.go +++ b/js.go @@ -1662,6 +1662,7 @@ func (js *js) subscribe(subj, queue string, cb MsgHandler, ch chan *Msg, isSync, // after the AddConsumer returns. if consumer == _EMPTY_ { sub.jsi.consumer = info.Name + sub.jsi.nms = fmt.Sprintf(js.apiSubj(apiRequestNextT), stream, info.Name) } sub.mu.Unlock() } From 726f0d8fb126a8766a010a0abc2af6ab958168a3 Mon Sep 17 00:00:00 2001 From: Byron Ruth Date: Fri, 29 Jul 2022 13:13:45 -0400 Subject: [PATCH 2/2] Add guard for pull mode Signed-off-by: Byron Ruth --- js.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js.go b/js.go index 256d4d001..d085789f1 100644 --- a/js.go +++ b/js.go @@ -1662,7 +1662,9 @@ func (js *js) subscribe(subj, queue string, cb MsgHandler, ch chan *Msg, isSync, // after the AddConsumer returns. if consumer == _EMPTY_ { sub.jsi.consumer = info.Name - sub.jsi.nms = fmt.Sprintf(js.apiSubj(apiRequestNextT), stream, info.Name) + if isPullMode { + sub.jsi.nms = fmt.Sprintf(js.apiSubj(apiRequestNextT), stream, info.Name) + } } sub.mu.Unlock() }