There is some problem in apache/dubbo-go when using multiple services under grpc protocol.
More detail, if you use multiple services under grpc protocol, only first service will be invoked successfully by consumers.
- Because services use the same address (or location in codes), so the
srv.Start(url)
will be executed only once. Refer to openServer. - Then the grpc server on provider side will register the first service. Refer to register in start.
- Firstly, we cannot fix this problem directly because
- the grpc server starts when the first service export and register
- then other service cannot register after grpc server start
- Then we should find a way to register service after server start
- apache/dubbo use a fallback method, refer to DubboHandlerRegistry implements HandlerRegistry
- we can use
UnknownServiceHandler
in grpc/grpc-go/server.go, like mwitkow/grpc-proxy
- Because we implement unary rpc by streaming rpc, we cannot use unaryInt.