[ISSUE #10500]Fix outdated constructor signatures in trace documentation#10501
Merged
Merged
Conversation
The two-argument constructors DefaultMQProducer(String, boolean) and DefaultMQPushConsumer(String, boolean) do not exist in 5.x. Updated to use the three-argument form with null for the default trace topic. Fixes apache#10500
RockteMQ-AI
approved these changes
Jun 15, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Fixes outdated constructor signatures in trace documentation to match the current codebase.
LGTM. Trivial documentation fix — keeps docs in sync with code. 👍
Automated review by github-manager-bot
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #10501 +/- ##
=============================================
- Coverage 48.13% 48.03% -0.11%
+ Complexity 13355 13327 -28
=============================================
Files 1377 1377
Lines 100707 100707
Branches 13010 13010
=============================================
- Hits 48477 48375 -102
- Misses 46296 46386 +90
- Partials 5934 5946 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ShannonDing
approved these changes
Jun 15, 2026
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.
Which Issue(s) This PR Fixes
Fixes #10500
Brief Description
The trace documentation (both English and Chinese) uses two-argument
constructors that do not exist in RocketMQ 5.x:
// ❌ Does not compile in 5.x
new DefaultMQProducer("ProducerGroupName", true)
new DefaultMQPushConsumer("CID_JODIE_1", true)
Verified by checking DefaultMQProducer.java — there is no
(String, boolean) constructor. The closest two-argument versions
accepts (String, RPCHook).
The correct three-argument form adds a third parameter for the
custom trace topic name. Passing null uses the system default
RMQ_SYS_TRACE_TOPIC:
// ✅ Compiles in 5.x
new DefaultMQProducer("ProducerGroupName", true, null)
new DefaultMQPushConsumer("CID_JODIE_1", true, null)
This PR fixes both English and Chinese trace user guides.
How Did You Test This Change?
During homework development, attempted to use
new DefaultMQProducer("TraceProducerGroup", true)and got:"no suitable constructor found for DefaultMQProducer(String,boolean)"
Checked the actual constructor list in
client/src/main/java/.../DefaultMQProducer.java and
client/src/main/java/.../DefaultMQPushConsumer.java
— confirmed no (String, boolean) signature exists
Successfully built and ran a trace-enabled producer using
new DefaultMQProducer("TraceProducerGroup", true, null)on RocketMQ 5.5.0 with traceTopicEnable=true on the broker.
Trace data appeared correctly in RMQ_SYS_TRACE_TOPIC,
verified via "mqadmin queryMsgTraceById".