You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/23 09:28:23 UTC

[GitHub] [apisix] xiaokunliu opened a new issue #5591: http json params to grpc service have discarded some params when using grpc transcode

xiaokunliu opened a new issue #5591:
URL: https://github.com/apache/apisix/issues/5591


   ### Issue description
   
   http json params to grpc service have discarded some params when using grpc transcode, this is the curl :
   
   curl --location --request POST 'http://apisix-gateway:9080/modelConfig/updateModelMessage' \
   --header 'Content-Type: application/json' \
   --data-raw '{"type":"lightGBM","joinTableList":[{"keyCol":"user_id","keyColInCombineTable":"user_id","table":{"conditions":[],"database":"dm","tableName":"dm_home_page_user_features"}},{"keyCol":"host_id","keyColInCombineTable":"host_id","table":{"conditions":[],"database":"dm","tableName":"dm_home_page_host_features"}}],"modelId":231,"trainDayDiff":1,"partitionArrange":[20211014,20211109],"name":"model12_copy","combineTable":{"conditions":[{"col":"ct","value":"click","op":"in_str"}],"database":"dm","tableName":"dm_feedctr_explose_click_sample_uid_ddi"}}
   '
   
   grpc service could not received the joinTableList, it is empty
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks --version`):
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tokers commented on issue #5591: http json params to grpc service have discarded some params when using grpc transcode

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5591:
URL: https://github.com/apache/apisix/issues/5591#issuecomment-976330042


   @xiaokunliu Please provide more details like your APISIX version, the Route and Upstream objects you created, and if possible, providing us the gRPC IDL.


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] xiaokunliu edited a comment on issue #5591: http json params to grpc service have discarded some params when using grpc transcode

Posted by GitBox <gi...@apache.org>.
xiaokunliu edited a comment on issue #5591:
URL: https://github.com/apache/apisix/issues/5591#issuecomment-978800613


   yes, others could pass, but address couldnt recieved, this is my backend grpc server log:
   
   {"lv":"info","ts":1637747510,"caller":"grpcserver/users.go:63","msg":"UpdateUserById,uid=1111,user=name:\"uname\" email:\"uemail\" userProfile:<uid:1111 loginName:\"user\" password:\"user\" balances:100 > tags:1 tags:2 tags:3 hobbies:\"footboall\" hobbies:\"basketball\" "}
   
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] xiaokunliu commented on issue #5591: http json params to grpc service have discarded some params when using grpc transcode

Posted by GitBox <gi...@apache.org>.
xiaokunliu commented on issue #5591:
URL: https://github.com/apache/apisix/issues/5591#issuecomment-977618994


   apisix version : apache/apisix:2.10.0-alpine


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tokers commented on issue #5591: http json params to grpc service have discarded some params when using grpc transcode

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5591:
URL: https://github.com/apache/apisix/issues/5591#issuecomment-977692674


   So it's OK to pass it to the backend gRPC server if the APISIX proxy is skipped?


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] xiaokunliu edited a comment on issue #5591: http json params to grpc service have discarded some params when using grpc transcode

Posted by GitBox <gi...@apache.org>.
xiaokunliu edited a comment on issue #5591:
URL: https://github.com/apache/apisix/issues/5591#issuecomment-977474026


   ok, my problem is in my IDL, the repeated type filed could not using json array to transfer grpc repeated type,like example as follow: 
   
   syntax = "proto3";
   package  api;
   service UserService {
    rpc UpdateUserById(UpdateUserByIdRequest) returns (UpdateUserByIdResult);
   
   message GetUserByIdResult {
     sint64 uid = 1;
     User user = 2;
   }
   
   message User {
     string name = 1;
     string email = 2;
     // address
     repeated UserAddress addresses = 3; 
     // profile
     UserProfile userProfile = 4;
     repeated sint64 tags = 5;
     repeated string hobbies = 6;
   }
   
   message UserProfile {
     sint64 uid = 1;
     string loginName = 2;
     string password = 3;
     sint64 balances = 4;
   }
   
   message UserAddress {
     string province = 1;
     string city = 2;
     string street = 3;
     string detail = 4;
   }
   }
   
   // the address could not get the value from http json array. and this is my curl request
   curl --location --request PUT 'http://apisix-gateway:19080/user/UpdateUserById' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "uid": 1111,
       "user": {
           "name": "uname",
           "email": "uemail",
           "addresses": [
               {
                   "province": "guangdong",
                   "city": "guangzhou",
                   "street": "haizhu",
                   "detail": "pazhou"
               }
           ],
           "userProfile": {
               "uid": "1111",
               "loginName": "user",
               "password": "user",
               "balances": 100
           },
           "tags": [1,2,3],
           "hobbies": ["footboall"]
       }
   }'
   
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] xiaokunliu commented on issue #5591: http json params to grpc service have discarded some params when using grpc transcode

Posted by GitBox <gi...@apache.org>.
xiaokunliu commented on issue #5591:
URL: https://github.com/apache/apisix/issues/5591#issuecomment-978800613


   yes, others could pass, but address couldnt recieved, this is my backend grpc server log:
   
   {"lv":"info","ts":1637747510,"caller":"grpcserver/users.go:63","msg":"UpdateUserById,req=1111,user=name:\"uname\" email:\"uemail\" userProfile:<uid:1111 loginName:\"user\" password:\"user\" balances:100 > tags:1 tags:2 tags:3 hobbies:\"footboall\" hobbies:\"basketball\" "}
   
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] xiaokunliu commented on issue #5591: http json params to grpc service have discarded some params when using grpc transcode

Posted by GitBox <gi...@apache.org>.
xiaokunliu commented on issue #5591:
URL: https://github.com/apache/apisix/issues/5591#issuecomment-977474026


   ok, my problem is in my IDL, the repeated type filed could not using json array to transfer grpc repeated type,like example as follow: 
   
   syntax = "proto3";
   package  api;
   service UserService {
    rpc UpdateUserById(UpdateUserByIdRequest) returns (UpdateUserByIdResult);
   
   message GetUserByIdResult {
     sint64 uid = 1;
     User user = 2;
   }
   
   message User {
     string name = 1;
     string email = 2;
     // address
     repeated UserAddress addresses = 3; 
     // profile
     UserProfile userProfile = 4;
     repeated sint64 tags = 5;
     repeated string hobbies = 6;
   }
   
   message UserProfile {
     sint64 uid = 1;
     string loginName = 2;
     string password = 3;
     sint64 balances = 4;
   }
   
   message UserAddress {
     string province = 1;
     string city = 2;
     string street = 3;
     string detail = 4;
   }
   }
   
   // the address could not get the value from http json array. and this is my curl request
   curl --location --request PUT 'http://hw-sg-nono-test1.livenono.com:19080/user/UpdateUserById' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "uid": 1111,
       "user": {
           "name": "uname",
           "email": "uemail",
           "addresses": [
               {
                   "province": "guangdong",
                   "city": "guangzhou",
                   "street": "haizhu",
                   "detail": "pazhou"
               }
           ],
           "userProfile": {
               "uid": "1111",
               "loginName": "user",
               "password": "user",
               "balances": 100
           },
           "tags": [1,2,3],
           "hobbies": ["footboall"]
       }
   }'
   
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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