Closed sgentry closed 6 months ago
It seems like we are receiving two ACKs for payload publishing, one from each domain e.g.:
--> PUB $O.app-payloads.C.X0wZEKrtI1yF0MUVaOevDD _INBOX.jNL85FQFkvrEfdz3DzIwyG.X0wZEKrtI1yFINUVaOevDD 9
<-- MSG _INBOX.jNL85FQFkvrEfdz3DzIwyG.X0wZEKrtI1yFINUVaOevDD 1 63
{"stream":"OBJ_app-payloads", "domain":"leaf-domain", "seq":19}
<-- MSG _INBOX.jNL85FQFkvrEfdz3DzIwyG.X0wZEKrtI1yFINUVaOevDD 1 62
{"stream":"OBJ_app-payloads", "domain":"hub-domain", "seq":11}
I had some progress on this one: The reason you're receiving two responses is because the object store is created twice - two different stores. Hence when you publish anything to the streams backing the store (e.g. Put) then both streams responding separately.
If you specify a domain for your JetStream context for both connections, you shouldn't see the issue:
var js = new NatsJSContext(nats, new NatsJSOpts(nats.Opts, domain: "hub-domain"));
Are the leaf nodes clustered? If not they need to be on separate JS domains. I think otherwise it's an invalid setup.
Are the leaf nodes clustered? If not they need to be on separate JS domains. I think otherwise it's an invalid setup.
Yes, I think so. Which explains the why there were two stores being created since it'd be undefined behaviour if it's an invalid setup.
Yes, the leaf nodes are clustered and configured with separate JS domains. The warning went away once I specified the domain
like mentioned above.
I think we're all good on this issue. Thanks for the assistance. Still learning how to configure clusters with JS...
Observed behavior
When running NATS configuration that has a
hub
connecting two remoteleaf
nodes, we observe an warning when publishing a file to object store on a leaf node when it has a consumer listening on another leaf.NATS.Client.Core.Internal.InboxSubBuilder[1004] Unregistered message inbox received for _INBOX.WqCK2S...
Expected behavior
Do not expect a warning message.
Server and client version
Server: 2.10.12 .NET Client: 2.2.0
Host environment
Running in Docker container using
nats:2.10.12-alpine3.19
image.Steps to reproduce
In order to reproduce, I've created a Docker compose file with two config files, to simulate the environment we've observed this behavior. Once that is running, you should be able to run code in Program.cs section below. From there, open the
/swagger
docs and chose a file to upload. This endpoint will publish file to object store. Observe console output to view warning message. Note: The warning is not always displayed on the first attempt. You may have to execute the file upload multiple times.docker-compose.yml
Config files for Docker container
hub.conf
leaf.conf
Web Api