reflectioncompilationgrpc

gRPC create stub from reflection server (not dynamic messages)


If I have a grpc server running that is exposing the reflection service, is there some way to connect to it and generate the stub in some language to call it?

Like using protoc but referencing the server instead of the .proto files

I don't want a way to dynamically call the message, but rather a way to generate the proper Java (or other languages) stub code


Solution

  • Do you want to generate Java code stubs by reflection? If so, you can use getproto gradle plugin

    It would generate proto schemes via reflection and then you could use the Protobuf plugin to compile them.