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

Update nats.ws to eliminate various deprecations #1

Open
gerhardcit opened this issue Mar 31, 2024 · 2 comments
Open

Update nats.ws to eliminate various deprecations #1

gerhardcit opened this issue Mar 31, 2024 · 2 comments

Comments

@gerhardcit
Copy link

gerhardcit commented Mar 31, 2024

This is a great example. Perfect for getting to get you going from scratch.

Project nats.ws = 1.8.1
Current nats.ws = 1.22 and
const sub = await nats.jetstream().subscribe("whiteboard", opts); shows that subscribe is deprecated?

Could you possible update this so we don't start of with deprecated options.

I generally find that nats.ws had some minor updates which introduces various deprecations. So the docs and the code samples adds an extra layer of trial and error when you just start of with NATS.

Related to this video https://www.youtube.com/watch?v=As5FojxWViI

@gerhardcit
Copy link
Author

I have looked at the examples in https://github.com/nats-io/nats.deno/blob/main/examples/jetstream/05_consume.ts
One problem with those examples are that they reference a lot of test util functions in the examples, which makes it difficult to follow the context of the stream manager vs stream and consumer etc.

I would suggest a clean example without test helper utilities for new comers to understand the basic context of setting up a jetstream consumer with websockets without all the noise.

Good examples are like good tests. It's should not depend on any helper functions that confuses the basic usage.

Best examples are ones you can copy and paste and it should work with minimal interference. and then cleanup and optimizes yourself based on your use case.

Having taking some pain in getting it to work easily, I would suggest the lack of easy adaptable examples is a deterrent for newbies and you developers to start using NATS and websockets.

@alexbozhenko
Copy link
Contributor

Hi, @gerhardcit.
We got a new library https://github.com/nats-io/nats.js
In #2
this example was updated to use it.

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

No branches or pull requests

2 participants