syntax = "proto3";

package com.ywt.gapi.mq;

option java_multiple_files = true;
option java_outer_classname = "MqProto";
option java_package = "com.ywt.gapi.mq";

//gRPC消息队列请求消息体
message ExecuteGRPCRequest {
    string method = 1; //gRPC方法名(/${package}.${service}/${method})，如：/com.ywt.gapi.mq.MQExecutorService/executeGRPC
    bytes data = 2; //gRPC方法的参数(byte序列化)
    int32 priority = 3; //优先级(暂时保留设计)
    string msgId = 4; //消息ID，不需传入(仅为了消息完整性而定义)
}

//gRPC请求消息体入队返回结果
message ExecuteGRPCResponse {
    int32 code = 1; //返回码(0：成功, 1：失败)
    string msgId = 2; //消息ID
}

//基于消息队列的导步执行器
service MQExecutorService {
    rpc executeGRPC (ExecuteGRPCRequest) returns (ExecuteGRPCResponse); //异步执行gRPC请求
}