You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/08/15 03:20:45 UTC

[GitHub] [incubator-brpc] Bobo-peng opened a new issue #1208: [E1002]Fail to find method 客户端和服务端的命名空间必须保持一致?

Bobo-peng opened a new issue #1208:
URL: https://github.com/apache/incubator-brpc/issues/1208


   之前使用thrift的时候,server和client的接口文件中的命名空间不一致,不会影响调用。
   但是用brpc后,及使用pb协议,发现命名空间修改后,调用失败了,报错:[E1002]Fail to find method,
   也就是proto接口文件里的package AAA.service;  改成了:package BBB.service;
   查到的错误出处在下面这块:
   `// NOTE(gejun): jprotobuf sends service names without packages. So the
           // name should be changed to full when it's not.
           butil::StringPiece svc_name(request_meta.service_name());
           if (svc_name.find('.') == butil::StringPiece::npos) {
               const Server::ServiceProperty* sp =
                   server_accessor.FindServicePropertyByName(svc_name);
               if (NULL == sp) {
                   cntl->SetFailed(ENOSERVICE, "Fail to find service=%s",
                                   request_meta.service_name().c_str());
                   break;
               }
               svc_name = sp->service->GetDescriptor()->full_name();
           }
           const Server::MethodProperty* mp =
               server_accessor.FindMethodPropertyByFullName(
                   svc_name, request_meta.method_name());
           if (NULL == mp) {
               cntl->SetFailed(ENOMETHOD, "Fail to find method=%s/%s",
                               request_meta.service_name().c_str(),
                               request_meta.method_name().c_str());
               break;`
   我估计是client和server的函数名full_name(包括前缀的命名空间)要完全一致,求大神们能解答一下?thrift是怎么实现的?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org