syntax = "proto3"; option optimize_for = LITE_RUNTIME; package bhome.msg; // message format : header(BHMsgHead) + body(variable types) message BHAddress { bytes mq_id = 1; // mqid, uuid bytes ip = 2; // int32 port = 3; } message ProcInfo { bytes id = 1; bytes name = 2; bytes public_info = 3; bytes private_info = 4; } message BHMsgHead { bytes msg_id = 1; repeated BHAddress route = 2; // for reply and proxy. int64 timestamp = 3; int32 type = 4; ProcInfo proc = 5; bytes topic = 6; // for request route } message BHMsg { // deprecated bytes msg_id = 1; int64 timestamp = 2; int32 type = 3; repeated BHAddress route = 4; // for reply and proxy. bytes body = 5; } enum MsgType { kMsgTypeInvalid = 0; kMsgTypeRequest = 1; kMsgTypeReply = 2; kMsgTypePublish = 3; kMsgTypeSubscribe = 4; kMsgTypeUnsubscribe = 5; kMsgTypeProcQueryTopic = 6; kMsgTypeProcQueryTopicReply = 7; kMsgTypeProcRegisterTopics = 8; kMsgTypeProcHeartbeat = 9; } message DataPub { bytes topic = 1; bytes data = 2; } message DataSub { repeated bytes topics = 1; } message DataRequest { bytes topic = 1; bytes data = 2; } message DataReply { bytes data = 1; } message DataProcRegister { ProcInfo proc = 1; repeated bytes topics = 2; } message DataProcHeartbeat { ProcInfo proc = 1; } message DataProcQueryTopic { bytes topic = 1; } message DataProcQueryTopicReply { BHAddress address = 1; } service TopicRequestReplyService { rpc Request (DataRequest) returns (DataReply); }