nats-io / nats.py

Python3 client for NATS
https://nats-io.github.io/nats.py/
Apache License 2.0
863 stars 177 forks source link

Add Service API #552

Closed Jarema closed 1 week ago

Jarema commented 5 months ago

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 commented 4 months ago

Hi can i work on this problem?

Jarema commented 4 months ago

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 commented 4 months ago

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 ?

skewty commented 1 month ago

@caspervonb seeing lots of issues w/o response / feedback and this python repo as a whole seems early beta at best based on issues being filed. Is the issue lack or time? There is no "Contributors" section in the projects README. Are PRs welcome?

I can help with many of the issues if the existing team is willing to put the time into timely reviews / merges.. Right now my feeling is that NATS for python is a non starter and mostly dead project. Some transparency would be appreciated.

caspervonb commented 1 month ago

@caspervonb seeing lots of issues w/o response / feedback and this python repo as a whole seems early beta at best based on issues being filed. Is the issue lack or time? There is no "Contributors" section in the projects README. Are PRs welcome?

We will be chopping down on the backlog shortly, currently heads down trying to bring parity with services and jetstream APIs. Contributions are always welcome @skewty, but please get clarification on the issue tracker first to avoid duplicate efforts etc. There's a nats-io slack as-well for more immediate feedback.

Currently we're implementing the services API as-well as jetstream simplification. Both of these are expected to land roughly within the month.

Right now my feeling is that NATS for python is a non starter and mostly dead project. Some transparency would be appreciated.

I'm here breathing new life into it, really pushing towards parity with the Go client within the next couple of weeks 😁