fantow commented on a change in pull request #2213:
URL: https://github.com/apache/rocketmq/pull/2213#discussion_r462064574
##########
File path:
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java
##########
@@ -61,10 +61,13 @@
static {
final String protocol = System.getProperty(SERIALIZE_TYPE_PROPERTY,
System.getenv(SERIALIZE_TYPE_ENV));
if (!isBlank(protocol)) {
+ byte protocolByte = -1;
try {
- serializeTypeConfigInThisServer =
SerializeType.valueOf(protocol);
+ protocolByte = (byte) Integer.parseInt(protocol);
+ System.out.println(protocolByte);
Review comment:
The method SerializeType.valueOf() need a byte type parameter.It will
get a wrong result when we put a String type parameter.
##########
File path:
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java
##########
@@ -61,10 +61,13 @@
static {
final String protocol = System.getProperty(SERIALIZE_TYPE_PROPERTY,
System.getenv(SERIALIZE_TYPE_ENV));
if (!isBlank(protocol)) {
+ byte protocolByte = -1;
try {
- serializeTypeConfigInThisServer =
SerializeType.valueOf(protocol);
+ protocolByte = (byte) Integer.parseInt(protocol);
+ System.out.println(protocolByte);
+ serializeTypeConfigInThisServer =
SerializeType.valueOf(protocolByte);
} catch (IllegalArgumentException e) {
- throw new RuntimeException("parser specified protocol error.
protocol=" + protocol, e);
+ throw new RuntimeException("parser specified protocol error.
protocol=" + serializeTypeConfigInThisServer, e);
}
Review comment:
Okay,I will fix it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]