different headers in micro grpc vs native grpc client #69

Closed
opened 2022-03-20 23:10:21 +03:00 by vtolstov · 4 comments
vtolstov commented 2022-03-20 23:10:21 +03:00 (Migrated from github.com)
call via micro grpc:
http req &http.Request{Method:"POST", URL:(*url.URL)(0x14000392360), Proto:"HTTP/2.0", ProtoMajor:2, ProtoMinor:0, Header:http.Header{"Content-Type":[]string{"application/grpc+proto"}, "Grpc-Timeout":[]string{"4998430u"}, "Te":[]string{"trailers"}, "Timeout":[]string{"5000000000"}, "User-Agent":[]string{"grpc-go/1.45.0"}}, Body:(*http2.requestBody)(0x14000380690), GetBody:(func() (io.ReadCloser, error))(nil), ContentLength:-1, TransferEncoding:[]string(nil), Close:false, Host:"127.0.0.1:52484", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"127.0.0.1:52485", RequestURI:"/helloworld.Test/Call", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.cancelCtx)(0x140000323c0)}
call via native grpc:
http req &http.Request{Method:"POST", URL:(*url.URL)(0x140000f3320), Proto:"HTTP/2.0", ProtoMajor:2, ProtoMinor:0, Header:http.Header{"Content-Type":[]string{"application/grpc"}, "Te":[]string{"trailers"}, "User-Agent":[]string{"grpc-go/1.45.0"}}, Body:(*http2.requestBody)(0x140001d2d20), GetBody:(func() (io.ReadCloser, error))(nil), ContentLength:-1, TransferEncoding:[]string(nil), Close:false, Host:"127.0.0.1:52484", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"127.0.0.1:52486", RequestURI:"/test.v1.Test/Call", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.cancelCtx)(0x140001eeec0)}
``` call via micro grpc: http req &http.Request{Method:"POST", URL:(*url.URL)(0x14000392360), Proto:"HTTP/2.0", ProtoMajor:2, ProtoMinor:0, Header:http.Header{"Content-Type":[]string{"application/grpc+proto"}, "Grpc-Timeout":[]string{"4998430u"}, "Te":[]string{"trailers"}, "Timeout":[]string{"5000000000"}, "User-Agent":[]string{"grpc-go/1.45.0"}}, Body:(*http2.requestBody)(0x14000380690), GetBody:(func() (io.ReadCloser, error))(nil), ContentLength:-1, TransferEncoding:[]string(nil), Close:false, Host:"127.0.0.1:52484", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"127.0.0.1:52485", RequestURI:"/helloworld.Test/Call", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.cancelCtx)(0x140000323c0)} ``` ``` call via native grpc: http req &http.Request{Method:"POST", URL:(*url.URL)(0x140000f3320), Proto:"HTTP/2.0", ProtoMajor:2, ProtoMinor:0, Header:http.Header{"Content-Type":[]string{"application/grpc"}, "Te":[]string{"trailers"}, "User-Agent":[]string{"grpc-go/1.45.0"}}, Body:(*http2.requestBody)(0x140001d2d20), GetBody:(func() (io.ReadCloser, error))(nil), ContentLength:-1, TransferEncoding:[]string(nil), Close:false, Host:"127.0.0.1:52484", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"127.0.0.1:52486", RequestURI:"/test.v1.Test/Call", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.cancelCtx)(0x140001eeec0)} ```
vtolstov commented 2022-03-20 23:17:04 +03:00 (Migrated from github.com)

mostly difference in request uri - method must be the same as drpc

mostly difference in request uri - method must be the same as drpc
vtolstov commented 2022-03-20 23:20:56 +03:00 (Migrated from github.com)
https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests
vtolstov commented 2022-03-20 23:21:38 +03:00 (Migrated from github.com)

must handle timeout header in both formats - micro with plain time.Duration and grpc with strings time.Duration with upper/lower char

must handle timeout header in both formats - micro with plain time.Duration and grpc with strings time.Duration with upper/lower char
vtolstov commented 2022-03-21 13:11:24 +03:00 (Migrated from github.com)

close for now

close for now
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: unistack-org/micro-client-grpc#69
No description provided.