[Redis 8.10]Add MAXCOUNT and MAXSIZE options to XREAD and XREADGROUP - #3859
Open
uglide wants to merge 2 commits into
Open
[Redis 8.10]Add MAXCOUNT and MAXSIZE options to XREAD and XREADGROUP#3859uglide wants to merge 2 commits into
uglide wants to merge 2 commits into
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 optional arguments on existing stream read APIs with no client-side parsing changes; behavior depends on Redis 8.10+ when the options are used.
Overview
Adds Redis 8.10 cumulative reply limits for stream reads via optional
maxCountandmaxSizeonXReadArgs(includingBuilderhelpers). When set,build()emitsMAXCOUNTandMAXSIZEon the wire for both XREAD and XREADGROUP; unset values stay omitted so older servers are unaffected.MAXCOUNTcaps total entries across all streams (unlike per-streamCOUNT).MAXSIZEis a soft byte budget on the serialized reply. Response parsing and client semantics are unchanged; invalid combinations surface as normal Redis errors.Coverage includes RESP encoding unit tests and integration tests (multi-stream cap, soft
MAXSIZE, empty reads, group pending counts, validation), gated on Redis 8.10+.Reviewed by Cursor Bugbot for commit 47894eb. Bugbot is set up for automated code reviews on this repo. Configure here.