Skip to content

Commit

Permalink
Fix for ignoring a private inbox prefix in jetstream publish.
Browse files Browse the repository at this point in the history
  • Loading branch information
oderwat committed Nov 19, 2023
1 parent 94fc961 commit a379552
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions jetstream/publish.go
Expand Up @@ -128,9 +128,8 @@ const (
const (
statusHdr = "Status"

inboxPrefix = "_INBOX."
rdigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
base = 62
rdigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
base = 62
)

func (js *jetStream) Publish(ctx context.Context, subj string, data []byte, opts ...PublishOpt) (*PubAck, error) {
Expand Down Expand Up @@ -310,7 +309,7 @@ func (js *jetStream) newAsyncReply() (string, error) {
for i := 0; i < aReplyTokensize; i++ {
b[i] = rdigits[int(b[i]%base)]
}
js.publisher.replyPrefix = fmt.Sprintf("%s%s.", inboxPrefix, b[:aReplyTokensize])
js.publisher.replyPrefix = fmt.Sprintf("%s%s.", js.conn.NewInbox(), b[:aReplyTokensize])
sub, err := js.conn.Subscribe(fmt.Sprintf("%s*", js.publisher.replyPrefix), js.handleAsyncReply)
if err != nil {
js.publisher.Unlock()
Expand Down

0 comments on commit a379552

Please sign in to comment.