[ISSUE #1443] Validate message body size before sending - #1444
Closed
tju-yxq wants to merge 1 commit into
Closed
Conversation
lizhimins
force-pushed
the
rocketmq-studio
branch
2 times, most recently
from
August 10, 2026 06:45
269e228 to
d58b463
Compare
lizhimins
force-pushed
the
fix/send-message-size-validation-1443
branch
from
August 10, 2026 09:06
d5b1585 to
d5d03ce
Compare
RockteMQ-AI
approved these changes
Aug 10, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
LGTM. Looks good.
Automated review by github-manager-bot
The send message endpoint did not validate body size, causing HTTP 500 for messages exceeding the 4MB broker limit. This fix adds a pre-send size check that returns HTTP 400 with a clear message. Fixes apache#1443
tju-yxq
force-pushed
the
fix/send-message-size-validation-1443
branch
from
August 10, 2026 10:34
d5d03ce to
9c705ed
Compare
lizhimins
pushed a commit
that referenced
this pull request
Aug 10, 2026
#1378, #1425, #1434, #1444) * [ISSUE #1353] Handle OFFSET_ILLEGAL in message and DLQ pull scans When PullResult returns OFFSET_ILLEGAL, the scan loop was breaking out of the current queue, silently dropping all remaining messages in that queue. The broker returns a corrected offset in nextBeginOffset that should be retried. This fix: - Adds OFFSET_ILLEGAL handling to both queryByTopic() and collectDeadLetters() with continue instead of break - Adds a max-retry guard (3 consecutive OFFSET_ILLEGAL per queue) to prevent infinite loops - Resets the counter on successful FOUND pulls - Preserves existing NO_NEW_MSG/NO_MATCHED_MSG break behavior Fixes #1353 * [ISSUE #1424] Fix UTF-8 body display truncation at multi-byte boundary When truncating message body for display, the truncation point could fall in the middle of a multi-byte UTF-8 character, causing the decoder to throw CharacterCodingException and fall through to BASE64 encoding even for valid UTF-8 text. This fix walks back the truncation point to the last complete UTF-8 character boundary before decoding. Fixes #1424 * [ISSUE #1433] Validate message query time range start < end The message query accepted inverted time ranges (start > end) without validation, returning zero results with no explanation. Fixes #1433 * [ISSUE #1443] Validate message body size before sending The send message endpoint did not validate body size, causing HTTP 500 for messages exceeding the 4MB broker limit. This fix adds a pre-send size check that returns HTTP 400 with a clear message. Fixes #1443
Member
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.
What is the purpose of the change
Fixes #1443
sendMessage()did not validate body size before sending, causing HTTP 500 for messages exceeding the 4 MB broker limit.Brief changelog
RocketMQAdminClientImpl.java: AddedMAX_MESSAGE_SIZEconstant (4 MB) and a pre-send size check that throwsBusinessException(400)with a clear message.Verifying this change
[ISSUE #1443] ....mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyleto make sure basic checks pass.