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

Changes to service framework #220

Open
8 of 13 tasks
aricart opened this issue May 18, 2023 · 4 comments
Open
8 of 13 tasks

Changes to service framework #220

aricart opened this issue May 18, 2023 · 4 comments
Assignees
Labels
client Client related work enhancement New feature or request

Comments

@aricart
Copy link
Member

aricart commented May 18, 2023

Overview

Changes to the service API to simplify its usage and future enhancements.

Remove schema from Service API

See changes to service/micro framework document PR 219

Change INFO response to contain endpoint details

See Change INFO response to contain endpoint details document PR 221

Clients and Tools

Other Tasks

  • docs.nats.io updated @bruth
  • Update ADR to Implemented
  • Update client features spreadsheet

Client authors please update with your progress. If you open issues in your own repositories as a result of this request, please link them to this one by pasting the issue URL in a comment or main issue description.

@aricart aricart added enhancement New feature or request client Client related work labels May 18, 2023
Jarema added a commit to nats-io/nats.rs that referenced this issue May 23, 2023
This addresses nats-io/nats-architecture-and-design#220

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Jarema added a commit to nats-io/nats.rs that referenced this issue May 23, 2023
This addresses nats-io/nats-architecture-and-design#220

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
@oderwat
Copy link

oderwat commented May 26, 2023

May I ask why this got removed? We found it excellent and used it already. Now we need to resort to the endpoint metadata, and as of now, these can only be queried through the "STATS". It seems that this metadata also is not really considered to be "there"? See: nats-io/nats.go#1270 (comment)

We think that having the schema and documentation information with the endpoints has many advantages, and seeing it in micro inspired us to use this instead of our own ideas about services that document themselves.

@ripienaar
Copy link
Contributor

@oderwat it would really help if you restricted your comments to one place. You are talking about this in 3 places now and it’s confusing

We like the idea of schemas to be clear but we felt until we have a clear strategy around it and perhaps some higher order integrations that’s more opinionated we would rather remove something now that’s perhaps a bit open ended and half baked and later return with better schema support. Rather than be stuck with a inadequate design for the long term one micro is GA

@oderwat
Copy link

oderwat commented May 26, 2023

Sorry for jumping around. I did not understand the connections between the issues at first.

Well, we have our concept for the schemas which is our [avrox](https://github.com/metatexx/avrox, that allows minimal message sizes, optional compression, versioning and full documentation through itself and a central registry, and we wrote tooling around that to automatically discover the schemas, auto-generate it from go structs, debug it through the "nats cli --translate" and some more features like supporting union responses because of the possibility to discover the actual schema used from the first bytes of the message, when given a list of possible ones. As this is not JSON but has a JSON schema description, this matched what was already implemented.

Here is an example output of a prototype tool that lists the schema usage:

tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.version="0.1.1+738.20230525235432.main-96c21daae5f6-dirty"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.meta.hostname="ibuero"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.meta.server="river"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.meta.type="microx"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-manager.subject="tspwa.v1.account.create"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-manager.avrox_res.CreateMsgReplyV1.nsv="10.1.1"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-manager.avrox_res.CreateMsgReplyV1.doc="CreateMsgReplyV1 is the answer on the create endpoint"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-manager.avrox_res.LiveMsgErrorReplyV1.nsv="10.4.1"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-manager.avrox_res.LiveMsgErrorReplyV1.doc=""
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-manager.avrox_req.BasicString.nsv="1.1.1"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-manager.avrox_req.BasicString.doc="BasicString is the container type to store a string in a single avro schema"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-health.subject="tspwa.v1.account.health"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-health.avrox_res.BasicMapStringAny.nsv="1.4.1"
tspwa-service.nvQtxSnGk7Q5r0wtQ3fd9w.endpoint.account-health.avrox_res.BasicMapStringAny.doc=""
tspwa-server.DuPwSEBZhABaFGn0bzXU02.version="0.4.12+595.20230525234655.main-96c21daae5f6-dirty"
tspwa-server.DuPwSEBZhABaFGn0bzXU02.meta.hostname="ibuero"
tspwa-server.DuPwSEBZhABaFGn0bzXU02.meta.server="river"
tspwa-server.DuPwSEBZhABaFGn0bzXU02.meta.type="microx"
tspwa-server.DuPwSEBZhABaFGn0bzXU02.avrox_msg.StatsEntryV1.nsv="10.5.1"
tspwa-server.DuPwSEBZhABaFGn0bzXU02.avrox_msg.StatsEntryV1.doc=""
tspwa-server.DuPwSEBZhABaFGn0bzXU02.avrox_msg.StatsEntryV1.subjects="tspwa.v1.accounts.*.store.stats.>"

We can do the same with just the micro top-level metadata, though. But I liked it much better to add this at the endpoint level.

I am still not clear if the endpoint metadata is supposed to exist or not. If not, please remove this from the code too, so we are forced to rewrite our code to match the "specs".

@Jarema
Copy link
Member

Jarema commented May 30, 2023

#221 has been added to this issue.

I'm not creating a new issue to avoid noise.

Unticking progress of all clients.
When your client is compatible with both PR's, please tick your client again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client related work enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants