Is there a preferred way of sending json over grpc?
I use org.json as a class representation of a json object in java and to send it via grpc. Since now just converted it to a json-string and sent it as a string over grpc, then i later parsed that string back into a json object.
But since there are structs in protobuf i wondered if those are better performancewise in some way or how i should work with json over grpc in general (preferably in java ->maybe gson is better here?).
The best way is use struct, if you are using json string, you need convert object as string, then serialize by protobuf and send to server, and server deserialize and parse string as json. If you use struct, only need serialize and deserialize. Performance will imporoved a lot.