grpc-transcode, report error when I havae "google protobuf Timestamp" type #6722
Unanswered
zhigangcao
asked this question in
Q&A
Replies: 1 comment
-
Also I used POST method, it will no error ,but my grpc server got nothing. usring spring-boot will report this warn: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
version: docker 2.13.0-centos
I tried to use apisix to convert http -> grpc,but it not work while my pb has timestamp type param.
1 - prepare protobuf
my protobuf like below:
hello.proto:
`
import "google/protobuf/timestamp.proto";
service MyExampleService {
rpc Greeter(HelloRequest) returns (HelloReply);
}
enum EnumTag{
ENUM_TAG_FIRST = 0;
ENUM_TAG_SECOND = 1;
ENUM_TAG_THIRD = 2;
}
message HelloRequest {
EnumTag enum_tag = 1;
string cliend_id = 2;
google.protobuf.Timestamp timestamp = 3;
}
message HelloReply {
}
`
2 - upload pb
and I use cmd below to upload my pb file:
`
`
3 - config setting
and setting the grpc-transcode plugin using dashboard with the json config like this:
{ "deadline": 0, "disable": false, "method": "Greeter", "pb_option": [ "enum_as_value" ], "proto_id": "myprotoid", "service": "hello.MyExampleService" }
test
curl -i "127.0.0.1:9080/test-hello?enum_tag=0&cliend_id=test×tamp=\{\"seconds\":123,\"nanos\":234\}"
or
curl -i "127.0.0.1:9080/test-hello?enum_tag=0&cliend_id=test×tamp="
error
[error] 52#52: *696235 [lua] grpc-transcode.lua:126: phase_func(): transform request error: failed to encode request data to protobuf, client: 172.20.0.1, server: _, request: "GET /test-hello?enum_tag=0&cliend_id=test×tamp= HTTP/1.1", host: "127.0.0.1:9080"
[warn] 52#52: *696235 [lua] plugin.lua:750: run_plugin(): grpc-transcode exits with http status code 400, client: 172.20.0.1, server: _, request: "GET /test-hello?enum_tag=0&cliend_id=test×tamp= HTTP/1.1", host: "127.0.0.1:9080"
what happened and ,how can i fix this? thx a lot!!!!
Beta Was this translation helpful? Give feedback.
All reactions