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 Admin.describeCluster #648

Merged
merged 8 commits into from
Mar 10, 2020
Merged

Add Admin.describeCluster #648

merged 8 commits into from
Mar 10, 2020

Conversation

Nevon
Copy link
Collaborator

@Nevon Nevon commented Mar 1, 2020

Returns metadata for all brokers in the cluster.

The API is roughly based on the Java Admin.describeCluster API. The big differences are:

  1. I'm exposing the nodes under a brokers property instead of nodes. The id is still called a nodeId, but I don't think we really use the Node terminology anywhere, so I went with brokers instead.
  2. The Java API has something called AuthorizedOperations that can be optionally included. I didn't add it as the current use-case doesn't need it, and I haven't actually looked into what it is or why you'd want it.

Usage is simply: await admin.describeCluster() and returns:

{
  brokers: [{ nodeId: 0, host: 'localhost', port: 9092 }],
  controller: 0,
  clusterId: 'foobar'
}

Fixes #647

@Nevon Nevon requested review from tulios and JaapRood March 1, 2020 13:12
docs/Admin.md Outdated Show resolved Hide resolved
src/admin/index.js Outdated Show resolved Hide resolved
@JaapRood
Copy link
Collaborator

JaapRood commented Mar 3, 2020

@Nevon overall, seems like a straightforward PR worth adding. The Java API having exposed it is generally a good indication there's a good reason for it, #647 gives useful context as well. The two design decisions seems totally on point to me.

@Nevon Nevon requested a review from JaapRood March 9, 2020 17:48
Copy link
Collaborator

@JaapRood JaapRood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

Comment on lines +189 to +190
Allows you to get information about the broker cluster. This is mostly useful
for monitoring or operations, and is usually not relevant for typical event processing.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Short and sweet way to prevent a whole bunch of confusion, nice!

@Nevon Nevon merged commit b5ffa13 into master Mar 10, 2020
@Nevon Nevon deleted the admin-describe-cluster branch March 10, 2020 12:25
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

Successfully merging this pull request may close these issues.

Expose cluster metadata in client(s)
4 participants