Repository navigation
[Redis 8.10]Add MAXCOUNT and MAXSIZE options to XREAD and XREADGROUP - #3859
Merged
Merged
Conversation
Redis 8.10 adds cumulative reply caps to the stream read commands: MAXCOUNT limits the total number of entries returned across all streams (unlike COUNT, which is per stream), and MAXSIZE applies a soft cap in bytes to the serialized reply. Expose both as optional XReadArgs settings (maxCount/maxSize) with Builder entry points. When unset, the keywords are omitted from the wire. Response shape, blocking, and consumer-group semantics are unchanged; server-side validation errors propagate as-is. Covered by wire-encoding unit tests and integration tests (cumulative cap across streams, oversized-first-entry MAXSIZE rule, no-message reply preservation, pending-entry accounting, error propagation), gated on Redis 8.10.
ggivo
approved these changes
Jul 29, 2026
ggivo
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Before merge need to sync since version
| * @param maxCount cumulative cap on the number of returned entries across all streams, must be positive. | ||
| * @return new {@link XReadArgs} with {@literal MAXCOUNT} set. | ||
| * @see XReadArgs#maxCount(long) | ||
| * @since 7.7 |
Contributor
There was a problem hiding this comment.
Sync on the actual version to be used for 8.10 support
Other 8.10 PR's #3858 use 7.8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Redis 8.10 adds cumulative reply caps to the stream read commands: MAXCOUNT limits the total number of entries returned across all streams (unlike COUNT, which is per stream), and MAXSIZE applies a soft cap in bytes to the serialized reply.
Expose both as optional XReadArgs settings (maxCount/maxSize) with Builder entry points. When unset, the keywords are omitted from the wire. Response shape, blocking, and consumer-group semantics are unchanged; server-side validation errors propagate as-is.
Covered by wire-encoding unit tests and integration tests (cumulative cap across streams, oversized-first-entry MAXSIZE rule, no-message reply preservation, pending-entry accounting, error propagation), gated on Redis 8.10.
Note
Low Risk
Additive API and protocol keywords only; existing read paths are unchanged when the new args are omitted, with coverage on encoding and Redis 8.10 behavior.
Overview
Adds optional Redis 8.10 reply limits for
XREADandXREADGROUPviaXReadArgs:maxCountcaps total entries across all streams (unlike per-streamCOUNT), andmaxSizeapplies a soft byte budget on the serialized reply. Both are exposed onXReadArgsandBuilder; unset values stay off the wire.CommandKeywordgainsMAXCOUNTandMAXSIZE, emitted fromXReadArgs.build()alongside existing options. Unit tests assert RESP encoding forXREAD/XREADGROUP; integration tests (gated on Redis 8.10+) cover cross-stream caps, MAXSIZE behavior, group pending accounting, and server validation errors.Reviewed by Cursor Bugbot for commit 6e94057. Bugbot is set up for automated code reviews on this repo. Configure here.