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

StreamInfo request changes to retrieve subjects #91

Open
7 of 12 tasks
aricart opened this issue Feb 2, 2022 · 0 comments
Open
7 of 12 tasks

StreamInfo request changes to retrieve subjects #91

aricart opened this issue Feb 2, 2022 · 0 comments
Assignees
Labels
client Client related work enhancement New feature or request

Comments

@aricart
Copy link
Member

aricart commented Feb 2, 2022

Overview

StreamInfo can now provide a list of subjects stored in the server. This functionality may be useful for KV to determine the list of keys that are present in one go, with the caveat that if more than 100,000 keys, the request for info with subject information will fail. Note that this will also include entries that would have been deleted.

StreamInfo adds the following fields under stream state (state):

...
num_subjects: number,
subjects?: Record<string,number>
...
  • the ? next to the field means the field will not be set unless the request was made to include it.
  • A Record<string,number> is a JSON object that indexes a count under its subject:
{"subjects":{"baz.bar.foo":1,"foo.bar.baz":10}}

The stream info request options adds the optional property:

 "subjects_filter": string;

To get all subjects in the stream, set subject_filter to the expected >

For more information see: nats-io/nats-server#2833

Clients and Tools

Other Tasks

Client authors please update with your progress. If you open issues in your own repositories as a result of this request, please link them to this one by pasting the issue URL in a comment or main issue description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client related work enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants