syntax = "proto3"; //声明proto的版本 只能 是3,才支持 grpc //声明 包名 package proto; //服务管理 service QueueService { //任务发布 rpc Publish (stream PubReq) returns (PubResp) { } //任务接收 rpc Receive (RecvReq) returns (stream PubReq) { } } //任务 message PubReq { string id = 1;//标示 string channelId = 2;//频道 string sender = 3;//发送人id int32 serial_type = 4;//序列化方式 0 raw bytes,1 json,2 grpc int32 publish_type = 5 ;//任务发布方式 0 随机 1 广播 bytes param = 6 ;//参数 } //标准字符串返回结果 message PubResp { int32 code = 1;//执行状态代码 string msg = 2;//执行状态 } message RecvReq{ string sender = 1; string channelId = 2; }