This is an automated email from the ASF dual-hosted git repository.
dongeforever pushed a commit to branch 5.0.0-alpha-static-topic
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/5.0.0-alpha-static-topic by
this push:
new 4070da8 Finish typo
4070da8 is described below
commit 4070da8ab07c132f6e339a3ebdbbcb736efab652
Author: dongeforever <[email protected]>
AuthorDate: Tue Nov 16 16:03:04 2021 +0800
Finish typo
---
.../main/java/org/apache/rocketmq/common/rpc/RpcClientUtils.java | 4 ++--
.../org/apache/rocketmq/remoting/protocol/RemotingCommand.java | 8 ++------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git
a/common/src/main/java/org/apache/rocketmq/common/rpc/RpcClientUtils.java
b/common/src/main/java/org/apache/rocketmq/common/rpc/RpcClientUtils.java
index 654b2ed..df14c22 100644
--- a/common/src/main/java/org/apache/rocketmq/common/rpc/RpcClientUtils.java
+++ b/common/src/main/java/org/apache/rocketmq/common/rpc/RpcClientUtils.java
@@ -8,13 +8,13 @@ import java.nio.ByteBuffer;
public class RpcClientUtils {
public static RemotingCommand createCommandForRpcRequest(RpcRequest
rpcRequest) {
- RemotingCommand cmd =
RemotingCommand.createRequestCommandWithHeader(rpcRequest.getHeader().getCode(),
rpcRequest.getHeader());
+ RemotingCommand cmd =
RemotingCommand.createRequestCommand(rpcRequest.getHeader().getCode(),
rpcRequest.getHeader());
cmd.setBody(encodeBody(rpcRequest.getBody()));
return cmd;
}
public static RemotingCommand createCommandForRpcResponse(RpcResponse
rpcResponse) {
- RemotingCommand cmd =
RemotingCommand.createResponseCommandWithHeader(rpcResponse.getCode(),
rpcResponse.getHeader());
+ RemotingCommand cmd =
RemotingCommand.createResponseCommandWithHeader(rpcResponse.getHeader().getCode(),
rpcResponse.getHeader());
cmd.setRemark(rpcResponse.getException() == null ? "" :
rpcResponse.getException().getMessage());
cmd.setBody(encodeBody(rpcResponse.getBody()));
return cmd;
diff --git
a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java
b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java
index 08bb202..f895b63 100644
---
a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java
+++
b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java
@@ -86,8 +86,7 @@ public class RemotingCommand {
protected RemotingCommand() {
}
-
- public static RemotingCommand createRequestCommandWithHeader(int code,
CommandCustomHeader customHeader) {
+ public static RemotingCommand createRequestCommand(int code,
CommandCustomHeader customHeader) {
RemotingCommand cmd = new RemotingCommand();
cmd.setCode(code);
cmd.customHeader = customHeader;
@@ -129,10 +128,7 @@ public class RemotingCommand {
}
public static RemotingCommand buildErrorResponse(int code, String remark) {
- final RemotingCommand response =
RemotingCommand.createResponseCommand(null);
- response.setCode(code);
- response.setRemark(remark);
- return response;
+ return buildErrorResponse(code, remark, null);
}