RongtongJin commented on code in PR #10536:
URL: https://github.com/apache/rocketmq/pull/10536#discussion_r3449490643
##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/header/PullMessageResponseHeader.java:
##########
@@ -52,10 +52,10 @@ public void checkFields() throws RemotingCommandException {
@Override
public void encode(ByteBuf out) {
- writeIfNotNull(out, "suggestWhichBrokerId", suggestWhichBrokerId);
- writeIfNotNull(out, "nextBeginOffset", nextBeginOffset);
- writeIfNotNull(out, "minOffset", minOffset);
- writeIfNotNull(out, "maxOffset", maxOffset);
+ writeLong(out, "suggestWhichBrokerId", suggestWhichBrokerId);
Review Comment:
These response fields also changed from "omit when unset" to "encode
explicit 0". `PullMessageProcessor` creates this response header before
validation, and several early error returns only set `forbiddenType`, code, and
remark, so those responses will now include `suggestWhichBrokerId=0`,
`nextBeginOffset=0`, `minOffset=0`, and `maxOffset=0` even though they were
never populated. That can hide initialization bugs and changes the wire shape
for error responses. Please keep the boxed/omitted semantics for response
fields, or add tests proving every encoded response path intentionally carries
those zero values.
##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/header/PullMessageRequestHeader.java:
##########
@@ -47,19 +47,19 @@ public class PullMessageRequestHeader extends
TopicQueueRequestHeader implements
@CFNotNull
private Integer queueId;
@CFNotNull
- private Long queueOffset;
+ private long queueOffset;
Review Comment:
This is a protocol header API/schema surface change. The schema baselines
still declare these fields as `java.lang.Long` with boxed setters in
`test/src/test/resources/schema/protocol/common.protocol.header.PullMessageRequestHeader.schema`
and `PullMessageResponseHeader.schema`, while this PR changes the storage type
to primitive and adds primitive setter overloads. Please update the schema
expectations, or explicitly document why this protocol/API baseline should
remain unchanged.
--
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]