dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

Multi-services gen error with dubbo-compiler

Open 734839030 opened this issue 1 year ago • 4 comments

image image

主要目的是想实现,dubbo 可以直接调服务,也可以直接调网关(号段路由)。dubbo reference 无法实现,所以想用两个接口区分。 image

734839030 avatar May 22 '23 16:05 734839030

@EarthChen @guohao @icodening PTAL

AlbumenJ avatar May 23 '23 12:05 AlbumenJ

暂时建议把 service 放在不同的 proto 文件中,后续版本会进行支持

EarthChen avatar May 24 '23 06:05 EarthChen

使用

image

和proto文件

syntax = "proto3";

option java_multiple_files = true; option java_package = "com.example.dubbomutiservice.proto"; option java_outer_classname = "UserServiceProto"; option objc_class_prefix = "DEMOSRV";

package userservice;

// The demo service definition. service UserService { rpc SayHello (HelloRequest) returns (HelloReply) {} }

service UserServiceGtw { rpc SayHello (HelloRequest) returns (HelloReply) {} }

// The request message containing the user's name. message HelloRequest { string name = 1; }

// The response message containing the greetings message HelloReply { string message = 1; } 没有复现编译error,请贴一下使用的plugin和Proto文件

xiaoyuuuuuupeng avatar May 29 '23 02:05 xiaoyuuuuuupeng

不要这行就会报哈 option java_outer_classname = "UserServiceProto";

734839030 avatar Jun 05 '23 07:06 734839030