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

Feature request: API for server/cluster info #443

Open
mprimi opened this issue Mar 27, 2023 · 3 comments
Open

Feature request: API for server/cluster info #443

mprimi opened this issue Mar 27, 2023 · 3 comments

Comments

@mprimi
Copy link
Contributor

mprimi commented Mar 27, 2023

I would find useful to have an API to learn about the cluster state, not specific to any streams or consumers.

JSM seems like a good place for it.

Looking at the natscli, I see that the implementation of server list is doing this via PING (source).

I could duplicate this code, but that seems like a fragile approach.

Could the natscli implementation get pushed down to JSM, where it can be reused?

@ripienaar
Copy link
Collaborator

I have considered it :) but these things like PING isn’t well managed under semver and often breaking changes so I don’t really wanted to build public APIs around them :(

@mprimi
Copy link
Contributor Author

mprimi commented Mar 27, 2023

Makes sense, looks like a lot of refactoring for relatively small set of use cases.

For anyone stumbling upon this.
I wanted that API to block until a newly created cluster is "ready".

As a workaround, manager.IsJetStreamEnabled seems to work well for the specific use case.

@ripienaar
Copy link
Collaborator

Yeah probsbly ok since account info api depends on meta.

Elsewhere I check like this https://github.com/ripienaar/nats-integration/blob/0b6e12360b30bd358479125769102436cd830455/suites/streams/suite_test.go#L103 I really really dislike these server info responses since they require the silly multi unmarshal to use. Really unfriendly

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