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

Added support for Subject reporting on StreamInfo requests #1010

Merged
merged 1 commit into from
Jun 30, 2022
Merged

Conversation

aricart
Copy link
Member

@aricart aricart commented Jun 29, 2022

[FEAT] added SubjectFilter to StreamInfoRequest. The field takes a subject/wildcard that instruct the request to provide information on matching subjects in StreamState.
[FEAT] added NumSubjects to StreamState enabling report for the number of subjects in the stream
[FEAT] added Subjects to StreamState a map of subject to the number of messages with the subject which gets populated if the StreamInfoRequest specifies a SubjectFilter

FIX #1009

jsm.go Outdated
DeletedDetails bool `json:"deleted_details,omitempty"`
// SubjectsFilter When set, returns information on the matched subjects - can be a wildcard or wild-carded subject
Copy link
Member

Choose a reason for hiding this comment

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

when set (lower) and wildcarded

@coveralls
Copy link

coveralls commented Jun 29, 2022

Coverage Status

Coverage increased (+0.05%) to 83.963% when pulling 557d648 on fix-1009 into dcbb65a on main.

go.mod Outdated Show resolved Hide resolved
jsm.go Outdated Show resolved Hide resolved
test/js_test.go Show resolved Hide resolved
jsm.go Show resolved Hide resolved
@@ -1702,6 +1702,42 @@ func TestPurgeStream(t *testing.T) {
}
}

func TestStreamInfoSubjectInfo(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

There already is a test called TestStreamInfo which tests basic stream info request (without parameters) as well as request with DeletedDetails == true.
So it would be nice to either extend this existing test with additional cases for SubjectInfo or at least rename TestStreamInfo to e.g. TestStreamInfoDeletedDetails to be consistent in naming.

Copy link
Member Author

@aricart aricart Jun 29, 2022

Choose a reason for hiding this comment

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

Renaming the other test to TestStreamInfoDeletedDetails

…a subject/wildcard that instruct the request to provide information on matching subjects in `StreamState`.

[FEAT] added `NumSubjects` to `StreamState` enabling report for the number of subjects in the stream
[FEAT] added `Subjects` to `StreamState` a map of subject to number of messages in the subject which gets populated if the `StreamInfoRequest` specifies a `SubjectFilter`

FIX #1009
@piotrpio
Copy link
Collaborator

LGTM

Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM

@aricart aricart merged commit d29a40a into main Jun 30, 2022
@aricart aricart deleted the fix-1009 branch June 30, 2022 14:08
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.

StreamInfo request doesn't allow reporting of subjects
5 participants