ServiceEndpoint 'group' field not not included in reported 'subject' during service discovery.
Observed behavior
When specifying a 'group' on ServiceEndpoint.builder(), the 'subject' reported by service discovery is incorrect.
(A repository with an example test case is available here - https://github.com/jimmydivvy/jNatsEndpointGroupBug)
If we have the following ServiceEndpoint as part of a service named EchoService
ServiceEndpoint
.builder()
.endpointName("Echo")
.endpointSubject("echo")
.group(Group("acme"))
Then we expect it to listen on the subject 'acme.echo' - which it does.
However if we perform service discovery, the subject name is incorrectly reported as just 'echo'
nats micro info EchoService
Endpoints:
Name: Echo
Subject: echo
Expected behavior
Reported subject should include the group name (i.e. 'acme.subject'), matching the subject the service is actually listening on.
Server and client version
// Both provided by nix-pkgs
nats-server: v2.9.22
nats-cli: 0.1.1
// JNats version
implementation("io.nats:jnats:2.17.0")
Host environment
MacOS Ventura 13.4
Steps to reproduce
- Checkout the example repository (https://github.com/jimmydivvy/jNatsEndpointGroupBug)
- Run
nats-serveron localhost - Run
./gradlew run
This will print out some assertions with expected and actual results
Thanks for bring this to our attention. This will be fixed pretty soon.
Fixed in https://github.com/nats-io/nats.java/pull/1010