nats-io / nats-architecture-and-design

Architecture and Design Docs
Apache License 2.0
196 stars 21 forks source link

StreamInfo request changes to retrieve subjects #91

Open aricart opened 2 years ago

aricart commented 2 years ago

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 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: https://github.com/nats-io/nats-server/pull/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.