Skip to content

fix: harden POP message validation and diagnostics - #10729

Open
Aias00 wants to merge 3 commits into
apache:developfrom
Aias00:fix/proxy-consumer-messageext-log-summary
Open

fix: harden POP message validation and diagnostics#10729
Aias00 wants to merge 3 commits into
apache:developfrom
Aias00:fix/proxy-consumer-messageext-log-summary

Conversation

@Aias00

@Aias00 Aias00 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Drop POP messages that do not have a valid receipt handle instead of returning an unusable message.
  • Keep POP message diagnostics payload-safe through compact message summaries.

Validation

mvn -q -pl proxy -am -Dtest=ConsumerProcessorTest -DfailIfNoTests=false test

Closes #10728
Closes #10784

Copilot AI review requested due to automatic review settings July 31, 2026 12:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.50%. Comparing base (293f588) to head (f175cea).

Files with missing lines Patch % Lines
...he/rocketmq/proxy/processor/ConsumerProcessor.java 57.14% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10729      +/-   ##
=============================================
- Coverage      48.62%   48.50%   -0.13%     
+ Complexity     13692    13652      -40     
=============================================
  Files           1381     1381              
  Lines         101464   101475      +11     
  Branches       13187    13189       +2     
=============================================
- Hits           49337    49216     -121     
- Misses         46142    46242     +100     
- Partials        5985     6017      +32     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review by github-manager-bot

Summary

Replaces raw MessageExt toString() logging in ConsumerProcessor.filterPopResult error paths with a compact summary, preventing body/property data leakage in logs.

Findings

  • [Info] Both replaced log sites (handle-null error and filterMessage failure) correctly use the summary helper instead of the raw object.
  • [Info] The summarizeMessageExt implementation is identical to the one in PR #10731 (LocalMessageService).

Suggestions

  • Code duplication: The same summarizeMessageExt method appears in both ConsumerProcessor (this PR) and LocalMessageService (PR #10731). Consider extracting it into a shared utility class to keep a single source of truth. This would also apply to any future similar PRs in the series.
  • Test coverage is solid — verifies that body bytes and property values are excluded while key metadata is preserved.

Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review by github-manager-bot

Summary

Replaces raw MessageExt.toString() in ConsumerProcessor error/warn logs with a summarizeMessageExt() summary to avoid dumping full message content.

Findings

  • [Info] ConsumerProcessor.java:191,238 — Two log sites updated to use summary instead of raw object. Both are error paths where full message dumps would be noisy.
  • [Info] ConsumerProcessor.java:248-259 — summarizeMessageExt() implementation is identical to the one in PR #10731 (LocalMessageService). Consider extracting to a shared utility.
  • [Info] Test coverage is present.

Cross-repo Note

Same summarizeMessageExt() as PR #10731. After both merge, a shared utility in common or proxy module would reduce maintenance burden.


Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary

Defensive fix with proper validation and test coverage. LGTM.


Automated review by github-manager-bot

@Aias00
Aias00 force-pushed the fix/proxy-consumer-messageext-log-summary branch from 2eaf5a8 to f175cea Compare August 15, 2026 07:35
@Aias00 Aias00 changed the title [ISSUE #10728] Avoid raw POP message logs fix: harden POP message validation and diagnostics Aug 15, 2026
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.

Proxy should not return POP messages without receipt handles Avoid logging raw MessageExt bodies in proxy ConsumerProcessor

4 participants