News for hackers. Stuff that matters.
Re:Application Load Balancers enables gRPC workloads with en... by sneak on Friday October 30, 2020 @01:51PM (#24944936)
This thread seems as good a place as any to ask:

Does anyone have experience (good, bad, otherwise) using the gRPC JSON transcoding option for real-world stuff? I'm debating using it (still need REST clients sometimes) but I'm not sure how hacky it is.

Re:Application Load Balancers enables gRPC workloads with en... by et1337 on Friday October 30, 2020 @01:57PM (#24945015)
We use it. It's pretty good. It has a lot of places you can hook in extra functionality. You get most of the HTTP error status codes for free, but we also have a filter that looks at outgoing protobuf messages for a certain field that indicates the messages is a response to a create request, and that allows us to return an HTTP 202 instead of 200. We were even able to do Amazon-style request signing. One thing about request signing is that if you use protobuf key-value maps, the order is not deterministic on the wire. This broke our signing. Key-value maps are kind of a protobuf hack anyway, so we ended up using an array of structs. When it came time to add the JSON gateway, we found it pretty easy to write custom JSON serialization/deserialization code to convert the structs to a JSON map. This is all in Go by the way.
Re:Application Load Balancers enables gRPC workloads with en... by mariojv on Friday October 30, 2020 @11:17PM (#24948890)
This is only somewhat related, but I've used Go's protojson lib for pretty printing protobuf encoded data: https://godoc.org/google.golang.org/protobuf/encoding/protoj...

They say not to rely on the output being stable, so I would recommend guaranteeing a stable translation yourself for a REST client. You can achieve this by translating from the JSON to your proto or grpc service structure yourself.

Re:Application Load Balancers enables gRPC workloads with en... by weitzj on Friday October 30, 2020 @01:59PM (#24945039)
The grpc Gateway in Go worked quite well for us. I have not tried the native Envoy decoding functionality, yet.

Also you should look at Google Artman on github/googleapis as sometimes it felt that defining the REST mappings in Protobuf were lacking some features. Using google artman you kind of mix/match Protobuf with yaml definitions of your service.

We never had to use it, though. It just depends on where you want to put your authentication information. As of today I would probably change my mind and make it explicitly in payload, I.e. Protobuf message and not fiddle with headers any more.

Re:Application Load Balancers enables gRPC workloads with en... by booi on Friday October 30, 2020 @01:52PM (#24944956)
It probably varies by the language and library but for java it has been flawless. I wouldn’t expect many issues for any major language.
Re:Application Load Balancers enables gRPC workloads with en... by human_error on Friday October 30, 2020 @11:53PM (#24949008)
We only use Python but we let Envoy to do the transcoding between gRPC and JSON. No issues.