Skip to content

[ISSUE #10500]Fix outdated constructor signatures in trace documentation#10501

Merged
ShannonDing merged 1 commit into
apache:developfrom
SummCoder:doc-fix-trace-constructor
Jun 15, 2026
Merged

[ISSUE #10500]Fix outdated constructor signatures in trace documentation#10501
ShannonDing merged 1 commit into
apache:developfrom
SummCoder:doc-fix-trace-constructor

Conversation

@SummCoder

Copy link
Copy Markdown
Contributor

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?

  1. During homework development, attempted to use
    new DefaultMQProducer("TraceProducerGroup", true) and got:
    "no suitable constructor found for DefaultMQProducer(String,boolean)"

  2. 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

  3. 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".

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 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

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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.03%. Comparing base (91cb333) to head (d060604).
⚠️ Report is 5 commits behind head on develop.

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.
📢 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.

@SummCoder SummCoder changed the title Fix outdated constructor signatures in trace documentation [ISSUE #10500]Fix outdated constructor signatures in trace documentation Jun 15, 2026
@ShannonDing ShannonDing merged commit 226e24f into apache:develop Jun 15, 2026
10 checks passed
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.

[Doc] Documentation Related Trace documentation uses outdated constructor signatures

4 participants