Closed kakserpom closed 1 year ago
If you want to use >
wildcard in any subject mapping, you cannot drop the >
from dest.
await jsm.streams.add({
name: 'first-stream',
subjects: [
'first-stream',
],
});
await jsm.streams.delete('second-stream')
await jsm.streams.add({
name: 'second-stream',
subjects: [
'second-stream.*',
],
republish: {
src: '>',
- dest: 'first-stream',
+ dest: 'first-stream.>',
},
})
it’s much easier to work with mappings by first trying them out in NATS cli:
nats server mapping ">" "dest.>"
Defect
Versions of
nats-server
and affected client libraries used:Version: 2.9.15 Git: [b91fa85]
Steps or code to reproduce the issue:
Expected result:
No error
Actual result:
I tried all variants: no
src
,src: 'second-stream.>'
, etc. Nothing works.And yet https://docs.nats.io/nats-concepts/jetstream/streams#republish says:
Source - An optional subject pattern which is a subset of the subjects bound to the stream. It defaults to all messages in the stream, e.g. >.