Closed Zambito1 closed 3 months ago
Thanks for the report,
Do you mind adding --trace to the command arguments?
Here you can see picking a domain does result in the API trying to access the stream in the domain:
$ nats sub --stream X --js-domain foo --trace
09:40:09 >>> $JS.foo.API.STREAM.INFO.X
this indicates its accessing the domain correctly
nats --js-domain A s add foo
nats --js-domain B s add bar
nats pub foo.foo foo
nats pub bar.bar bar
nats --js-domain B sub --stream foo --trace # Note, foo is on domain A
<<< Reply Subject: $JS.ACK.foo.OKmk1lpA.1.1.1.1718197970030690510.0
[#1] Received JetStream message: stream: foo seq 1 / subject: foo.foo / time: 2024-06-12T09:12:50-04:00
foo
nats --js-domain B sub --stream bar --trace
nats: error: nats: stream not found
nats --js-domain B s ls # Shows bar with 1 message
The —trace flag is only useful if you show the new output like in my example.
Sorry, I'm not sure what you mean. Are you referring to the output of the sub --stream bar --trace
? If so, I copied the output verbatim:
Same with the sub --stream foo --trace
:
Ok perhaps the trace behaviour are in main only. To me this seems fixed for the next release.
Yes, fixed here https://github.com/nats-io/natscli/commit/b213da188a4e91b51862869868e50996c92c9ca6 and not yet released.
Observed behavior
When you connect to a server that is in one JS domain and you specify
--js-domain
or use a context with a JS domain specified you cannot subscribe to streams from the specified domain, but you can subscribe to streams from the domain of the server you are connected to.Expected behavior
You should be able to subscribe to streams from other JS domains, and you should not be able to subscribe to streams from the JS domain of the current server when you specify a domain other than the one the server is in.
Server and client version
CLI: 0.1.4 Server: 2.10.16
Host environment
Running the official Docker containers on a 64 bit GNU/Linux machine.
Steps to reproduce
nats --js-domain SERVER_A_DOMAIN -s nats://SERVER_B sub --stream SERVER_A_STREAM
and observe that the stream is "not found".nats --js-domain SERVER_A_DOMAIN -s nats://SERVER_B sub --stream SERVER_B_STREAM
and observe that the subscription works, even though the stream is not in the specified domain.