You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/20 08:45:06 UTC

[GitHub] [rocketmq] xiaorongZheng opened a new issue, #5742: RemotingCommand static code is wrong

xiaorongZheng opened a new issue, #5742:
URL: https://github.com/apache/rocketmq/issues/5742

   org.apache.rocketmq.remoting.protocol.RemotingCommand
   static {
           final String protocol = System.getProperty(SERIALIZE_TYPE_PROPERTY, System.getenv(SERIALIZE_TYPE_ENV));
           if (!isBlank(protocol)) {
               try {
                   serializeTypeConfigInThisServer = SerializeType.valueOf(protocol);
               } catch (IllegalArgumentException e) {
                   throw new RuntimeException("parser specified protocol error. protocol=" + protocol, e);
               }
           }
       }
   uncorrect use with SerializeType#valueof method,The protocol type should change to byte
   


-- 
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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] RemotingCommand static code is wrong [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5742:
URL: https://github.com/apache/rocketmq/issues/5742#issuecomment-1867071005

   This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] mxsm commented on issue #5742: RemotingCommand static code is wrong

Posted by GitBox <gi...@apache.org>.
mxsm commented on issue #5742:
URL: https://github.com/apache/rocketmq/issues/5742#issuecomment-1360649821

   Hi @xiaorongZheng  SerializeType#valueof paramter is string that this method is enum method, you can custom a enum has the valueof (String xxx) method. So this code is correct. 
   
   ```java
       public static SerializeType valueOf(byte code) {
           for (SerializeType serializeType : SerializeType.values()) {
               if (serializeType.getCode() == code) {
                   return serializeType;
               }
           }
           return null;
       }
   ```
   The above code was used in the following place.
   ```java
   //RemotingCommand#getProtocolType
       public static SerializeType getProtocolType(int source) {
           return SerializeType.valueOf((byte) ((source >> 24) & 0xFF));
       }
   ```
   
   
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] RemotingCommand static code is wrong [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #5742: RemotingCommand static code is wrong
URL: https://github.com/apache/rocketmq/issues/5742


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] RemotingCommand static code is wrong [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5742:
URL: https://github.com/apache/rocketmq/issues/5742#issuecomment-1868618218

   This issue was closed because it has been inactive for 3 days since being marked as stale.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org