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 MaxRequestMaxBytes consumer option #1043

Merged
merged 2 commits into from Aug 15, 2022

Conversation

bruth
Copy link
Member

@bruth bruth commented Aug 11, 2022

No description provided.

test/js_test.go Outdated
t.Fatal(err)
}
defer sub.Unsubscribe()
if _, err := sub.Fetch(10); err == nil || !strings.Contains(err.Error(), "MaxRequestMaxBytes of 100") {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like there is no message at this point and so this fails with a timeout and not what you expect. I know that this test can be tricky because those t.Run() may influence the other ones, but you could try to send at least 1 message that is big enough before creating the pull subscribe to see if you get the expected error.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. I realized this was only partially implemented because the fetch request wasn't including the MaxBytes option. I added a pull option which can be used to set this in the fetch request. This is now rejected regardless if a message is available.

Signed-off-by: Byron Ruth <b@devel.io>
Signed-off-by: Byron Ruth <b@devel.io>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 85.628% when pulling 2de06e0 on bruth:max-request-max-bytes into 30d5319 on nats-io:main.

@bruth bruth marked this pull request as ready for review August 15, 2022 12:57
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

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.

None yet

3 participants