SummCoder opened a new pull request, #10501:
URL: https://github.com/apache/rocketmq/pull/10501
### 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".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]