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

Support for NGS #11

Closed
ColinSullivan1 opened this issue Jan 18, 2019 · 3 comments
Closed

Support for NGS #11

ColinSullivan1 opened this issue Jan 18, 2019 · 3 comments

Comments

@ColinSullivan1
Copy link

Hello @jirenius!

Via twitter, one of your users requested support for NGS, the global digital dial-tone for NATS. All that is required to do this is to support a new type of NATS credential in Resgate. It's build into NATS, so no new dependencies for you.

Anyhow, we'd like to help you out.

Instructions to setup a free NGS account can be found here, and then you can use the creds file created in the signup process in your connect API. For resgate, you'd only need to support passing a creds file to your NATS connection as a type of credential.

e.g.

nc, err := Connect(url, UserCreds(“~/.nkeys/synadia/accounts/ngs/users/ngs.creds”)

Let us know if this is something you're interested in, and we'd be happy to help. If you are busy we can submit a PR. Our nats-sub example also demonstrates how to do this.

We're excited to see our users ask about Resgate!

/cc @nats-io/core

Thanks,
Colin

@jirenius
Copy link
Owner

Hi @ColinSullivan1 !

I am also excited to hear people interested in using Resgate with NGS!

To add the option to Resgate to pass a creds-file is something I can put on high priority, as it is such a small effort for a rather valuable feature.

For libraries such as go-res, this is already supported, as you may pass a nats.Conn to res.Serve already.

My only concern is that Resgate relies on the nats.SetReconnectHandler to know if some incoming/outgoing messages might have been missed/lost - in which case it will take measures to recover from possibly lost data.

With NGS, is there a risk that a message that is published by one client will never be receieved by the subscribing client without any of the clients getting any indication that something might be amiss (such a Reconnect callback)?

When you have a single NATS server instance, this is not the case - then at least one of the clients will know something might have gone wrong. But with a cluster, if I've understood it correctly, the connection between two NATS servers might be temporarily lost, resulting in lost messages, without the clients having any sort of notification on this?
Is it similar for NGS?

I might need to discuss the issue on NATS Slack, to get more info.

Best regards,
Samuel

@ColinSullivan1
Copy link
Author

NATS slack is great, and we can update this issue after discussion. NGS does use a cluster (in fact superclusters - a newer feature), and you are correct - you could miss a message if there is a network event/upgrade going on within NGS and you wouldn't be able to detect it. Have you thought about using the request/reply pattern to timeout and detect error conditions, crashes, etc?

@jirenius
Copy link
Owner

Closing as continued on Resgate issue resgateio/resgate#63

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