RongtongJin commented on a change in pull request #2213:
URL: https://github.com/apache/rocketmq/pull/2213#discussion_r463430309
##########
File path:
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java
##########
@@ -61,10 +63,12 @@
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);
+ serializeTypeConfigInThisServer =
SerializeType.valueOf(protocolByte);
} catch (IllegalArgumentException e) {
- throw new RuntimeException("parser specified protocol error.
protocol=" + protocol, e);
+ e.printStackTrace();
}
Review comment:
IMO, no need to catch Runtime exception.
----------------------------------------------------------------
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]