Can't see more than one service when using reflection
howey opened this issue · 3 comments
howey commented
Hi all,
I have a server with two services: Service_A and Service_B. When I use reflection I can only see Service_A. I can see both services if I manually use the .proto files. Any idea what I'm doing wrong?
Using Wombat_v0.4.0_Linux_x86_64.tar.gz
Thanks
server.cpp:
#include <grpcpp/grpcpp.h>
#include <string>
#include "service_a.grpc.pb.h"
#include "service_b.grpc.pb.h"
using grpc::Server;
using grpc::ServerBuilder;
using grpc::ServerContext;
using grpc::Status;
using service_a::Service_A;
using service_b::Service_B;
class ServiceAImplementation final : public Service_A::Service {};
class ServiceBImplementation final : public Service_B::Service {};
void Run() {
std::string address{"0.0.0.0:5000"};
ServiceAImplementation service_a;
ServiceBImplementation service_b;
ServerBuilder builder;
builder.AddListeningPort(address, grpc::InsecureServerCredentials());
builder.RegisterService(&service_a);
builder.RegisterService(&service_b);
std::unique_ptr<Server> server(builder.BuildAndStart());
std::cout << "server listening on port: " << address << std::endl;
server->Wait();
}
int main(int argc, char** argv) {
Run();
return 0;
}
service_b.proto:
syntax = "proto3";
package service_b;
service Service_B{
rpc DoThing(ThingIn) returns (ThingOut) {}
}
message ThingIn {}
message ThingOut {}
service_a.proto:
syntax = "proto3";
package service_a;
service Service_A{
rpc DoThing(ThingIn) returns (ThingOut) {}
}
message ThingIn {}
message ThingOut {}
Working with grpc-client-cli
:
$ grpc-client-cli localhost:5000
? Choose a service: [Use arrows to move, enter to select, type to filter]
→ grpc.reflection.v1alpha.ServerReflection
service_a.Service_A
service_b.Service_B
rogchap commented
howey commented
Nope, I don't see grpc.reflection.v1alpha.ServerReflection
either.
As another test I tried out grpcui
, and the issue is similar. To me it seems like there is a problem in a library that's used by Wombat
~/go/bin/grpcui -plaintext localhost:5000
Failed to compute set of methods to expose: Symbol not found: service_b.Service_B
raphaelzulliger commented