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

Add Service API #552

Open
Jarema opened this issue Apr 5, 2024 · 3 comments
Open

Add Service API #552

Jarema opened this issue Apr 5, 2024 · 3 comments

Comments

@Jarema
Copy link
Member

Jarema commented Apr 5, 2024

Proposed change

Implement Service API spec: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-32.md

Use case

Simplify the development of NATS micro-services.

The design goal of the API is to reduce development to having a complexity similar to that of writing a NATS subscription, but then by using simple configuration, allow the specified metadata to allow for standardization of discovery and observability.

@yash97
Copy link

yash97 commented Apr 14, 2024

Hi can i work on this problem?

@Jarema
Copy link
Member Author

Jarema commented Apr 14, 2024

Hi @yash97

Contributions are very welcome!
However there is some work in progress. Let me find the branch and see if there was progress recently to avoid any duplication of efforts.

@charbonnierg
Copy link
Contributor

charbonnierg commented Apr 14, 2024

You might want to check https://github.com/charbonats/nats-micro

There are some tests: https://github.com/charbonats/nats-micro/blob/main/tests/test_micro.py

Note that I created https://github.com/charbonats/nats-request-many and it's used as a dependency. It's also tested: https://github.com/charbonats/nats-request-many/blob/next/tests/test_request_many.py.

EDIT: In no case I'm suggesting to use my library, instead I'm suggesting it as an inspiration for writing a PR. We're using this library at work for a new product without problem fow now, but we did not put it in production yet.

Also, I'm convinced that a CLI is a game changer for this feature and I hope that this would be introduced in nats-py. Having no "standard way" to run a nats micro service is not harmful to existing NATS users, but may refrain new users from using this feature. It would be awesome to be able to start a NATS app as easily as you can start an ASGI or WSGI application using uvicorn/gunicorn today. I tried to come up with a solution in my library, you can see the example usage: https://charbonats.github.io/nats-micro/#example-usage. I'm not convinced it's the correct design, but it has proven to be extremely useful for quick prototyping at work. @Jarema , @wallyqs maybe you have an opinion on this subject ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants