Skip to content

Commit dfcb02d

Browse files
authored
[FIXED] Use mirror-aware prefix when updating KV key (#1903)
Create a valid Subject for mirrored streams by using the `kv.putPre` prefix which references the subject in the remote domain
1 parent 0bba2a9 commit dfcb02d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jetstream/kv.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,11 @@ func (kv *kvs) updateRevision(ctx context.Context, key string, value []byte, rev
10441044
if kv.useJSPfx {
10451045
b.WriteString(kv.js.opts.apiPrefix)
10461046
}
1047-
b.WriteString(kv.pre)
1047+
if kv.putPre != "" {
1048+
b.WriteString(kv.putPre)
1049+
} else {
1050+
b.WriteString(kv.pre)
1051+
}
10481052
b.WriteString(key)
10491053

10501054
m := nats.Msg{Subject: b.String(), Header: nats.Header{}, Data: value}

0 commit comments

Comments
 (0)