Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use standard connection create inbox for discovery #857

Merged
merged 1 commit into from
Mar 14, 2023
Merged

Conversation

scottf
Copy link
Contributor

@scottf scottf commented Mar 13, 2023

and also allow the user to provide their own supplier. Addressing #856

Copy link

@unixunion unixunion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have successfully tested this by building a snapshot of jnats and retrofitting a demo app to use the new inboxSupplier. So the PING inbox topic can now be correctly set when using JWT's for restricting access.

Discovery discovery = new Discovery(nc, 1000, 3);
discovery.setInboxSupplier(new CustomInboxSupplier());
List<PingResponse> pingResponses = discovery.ping();
2023-03-14T07:57:44.355+01:00  INFO 65558 --- [           main] c.k.a.n.demos.schemas.MicroClientHelper  : Discovered: "PingResponse":{"id":"Hxx8Kh9k5MhGtJp9OlFnoF","name":"HelloWorld-Service","version":"0.0.1-SNAPSHOT","type":"io.nats.micro.v1.ping_response"}
2023-03-14T07:57:44.355+01:00  INFO 65558 --- [           main] c.k.a.n.demos.schemas.MicroClientHelper  : Info...
2023-03-14T07:57:45.359+01:00  INFO 65558 --- [           main] c.k.a.n.demos.schemas.MicroClientHelper  : Info: "InfoResponse":{"id":"Hxx8Kh9k5MhGtJp9OlFnoF","name":"HelloWorld-Service","version":"0.0.1-SNAPSHOT","description":"A rich greeter experience","subjects":["hello"],"type":"io.nats.micro.v1.info_response"}
2023-03-14T07:57:45.359+01:00  INFO 65558 --- [           main] c.k.a.n.demos.schemas.MicroClientHelper  : Schemas...
2023-03-14T07:57:46.366+01:00  INFO 65558 --- [           main] c.k.a.n.demos.schemas.MicroClientHelper  : Schema: "SchemaResponse":{"id":"Hxx8Kh9k5MhGtJp9OlFnoF","name":"HelloWorld-Service","version":"0.0.1-SNAPSHOT","api_url":"http:\/\/spec.url","endpoints":[{"name":"HelloWorld","subject":"hello","schema":{"request":"syntax = \"proto3\";\npackage com.kindredgroup.arch.nats.demos;\n\nimport \"Common.proto\";\n\noption java_package = \"com.kindredgroup.arch.nats.demos.schemas\";\noption java_outer_classname = \"HelloWorldRequestProto\";\n\nmessage HelloWorldRequest {\n  Header header = 1;\n  string name = 2;\n}","response":"syntax = \"proto3\";\npackage com.kindredgroup.arch.nats.demos;\n\nimport \"Common.proto\";\n\noption java_package = \"com.kindredgroup.arch.nats.demos.schemas\";\noption java_outer_classname = \"HelloWorldResponseProto\";\n\nmessage HelloWorldResponse {\n  Header header = 1;\n  string greeting = 2;\n}"}}],"type":"io.nats.micro.v1.schema_response"}

Copy link
Collaborator

@arondi arondi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@scottf scottf merged commit 21b4fdc into main Mar 14, 2023
@scottf scottf deleted the discovery-inbox branch March 14, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants