You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/10/21 04:00:02 UTC

[GitHub] [rocketmq-client-cpp] shenhui0509 opened a new pull request #334: fix SendMessageRequestHeader Serialization bug

shenhui0509 opened a new pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334


   ## What is the purpose of the change
   
   Fix Bug for Send batch messages
   
   ## Brief changelog
   
   let bool fields in request header be serialized into bool rather than "1" for "0"; 
   
   ## Verifying this change
   
   XXXX
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when a cross-module dependency exists.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-cpp] ifplusor merged pull request #334: fix SendMessageRequestHeader Serialization bug

Posted by GitBox <gi...@apache.org>.
ifplusor merged pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-cpp] ifplusor commented on pull request #334: fix SendMessageRequestHeader Serialization bug

Posted by GitBox <gi...@apache.org>.
ifplusor commented on pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334#issuecomment-713300299


   I think you can add a specialization of ```UtilAll::to_string``` such as:
   
   ```c++
   template <>
   inline std::string UtilAll::to_string<bool>(bool value) {
     return value ? "true" : "false";
   }
   ```
   
   see: https://github.com/ifplusor/rocketmq-client-cpp/blob/a750efad307a98c49b20d2beebc763633af2e472/src/common/UtilAll.h#L153


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-cpp] ifplusor edited a comment on pull request #334: fix SendMessageRequestHeader Serialization bug

Posted by GitBox <gi...@apache.org>.
ifplusor edited a comment on pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334#issuecomment-713300299


   The extFields is map<string, string>, so I think you should add a specialization of ```UtilAll::to_string``` such as:
   
   ```c++
   template <>
   inline std::string UtilAll::to_string<bool>(bool value) {
     return value ? "true" : "false";
   }
   ```
   
   see: https://github.com/ifplusor/rocketmq-client-cpp/blob/a750efad307a98c49b20d2beebc763633af2e472/src/common/UtilAll.h#L153


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-cpp] shenhui0509 commented on pull request #334: fix SendMessageRequestHeader Serialization bug

Posted by GitBox <gi...@apache.org>.
shenhui0509 commented on pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334#issuecomment-713624787


   > The extFields is map<string, string>, so I think you should add a specialization of `UtilAll::to_string`. For example:
   > 
   > ```c++
   > template <>
   > inline std::string UtilAll::to_string<bool>(bool value) {
   >   return value ? "true" : "false";
   > }
   > ```
   > 
   > see: https://github.com/ifplusor/rocketmq-client-cpp/blob/a750efad307a98c49b20d2beebc763633af2e472/src/common/UtilAll.h#L153
   
   resolved


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-cpp] ifplusor edited a comment on pull request #334: fix SendMessageRequestHeader Serialization bug

Posted by GitBox <gi...@apache.org>.
ifplusor edited a comment on pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334#issuecomment-713300299


   The extFields is map<string, string>, so I think you should add a specialization of ```UtilAll::to_string```. For example:
   
   ```c++
   template <>
   inline std::string UtilAll::to_string<bool>(bool value) {
     return value ? "true" : "false";
   }
   ```
   
   see: https://github.com/ifplusor/rocketmq-client-cpp/blob/a750efad307a98c49b20d2beebc763633af2e472/src/common/UtilAll.h#L153


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-cpp] shenhui0509 edited a comment on pull request #334: fix SendMessageRequestHeader Serialization bug

Posted by GitBox <gi...@apache.org>.
shenhui0509 edited a comment on pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334#issuecomment-713284984


   the send message request header is serialized to 
   ```
   {"code":10,"extFields":{"batch":"1","unitMode":"0"},"flag":0,"language":"JAVA","opaque":0,"serializeTypeCurrentRPC":"JSON","version":0}
   ```
   however in broker the boolean field is deserialized as false, so treat the send batch request as a single message, results in bug.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-cpp] shenhui0509 commented on pull request #334: fix SendMessageRequestHeader Serialization bug

Posted by GitBox <gi...@apache.org>.
shenhui0509 commented on pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334#issuecomment-713284984


   the send message request header is serialized to 
   ```
   {"code":10,"extFields":{"batch":"1","unitMode":"false"},"flag":0,"language":"JAVA","opaque":0,"serializeTypeCurrentRPC":"JSON","version":0}
   ```
   however in broker the boolean field is deserialized as false, so treat the send batch request as a single message, results in bug.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-cpp] shenhui0509 commented on pull request #334: fix SendMessageRequestHeader Serialization bug

Posted by GitBox <gi...@apache.org>.
shenhui0509 commented on pull request #334:
URL: https://github.com/apache/rocketmq-client-cpp/pull/334#issuecomment-713285401


   ping @ifplusor @ShannonDing 


----------------------------------------------------------------
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:
users@infra.apache.org