From d70afff273df67d0eb029ea16fa68a84faa9c200 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期二, 20 七月 2021 19:26:50 +0800
Subject: [PATCH] 调整Request C.BHFree的位置
---
proto/source/bhome_msg.proto | 136 ++++++++++++++++++++++++--------------------
1 files changed, 74 insertions(+), 62 deletions(-)
diff --git a/proto/source/bhome_msg.proto b/proto/source/bhome_msg.proto
index a8e5073..b1f9772 100644
--- a/proto/source/bhome_msg.proto
+++ b/proto/source/bhome_msg.proto
@@ -1,92 +1,104 @@
syntax = "proto3";
-
option optimize_for = LITE_RUNTIME;
+option go_package="./bhome_msg";
-package bhome.msg;
+// import "google/protobuf/descriptor.proto";
+import "bhome_msg_api.proto";
+import "error_msg.proto";
-// message format : header(BHMsgHead) + body(variable types)
-message BHAddress {
- bytes mq_id = 1; // mqid, uuid
- bytes ip = 2; //
- int32 port = 3;
-}
+package bhome_msg;
-message ProcInfo
-{
- bytes id = 1;
- bytes name = 2;
- bytes public_info = 3;
- bytes private_info = 4;
-}
+
+// message format : head_len(4) + head(BHMsgHead) + body_len(4) + body(variable types)
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
+ uint64 ssn_id = 5; // node mq id
+ bytes proc_id = 6;
+ bytes topic = 7; // for request route
+ BHAddress dest = 8; // other host
}
-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;
+ kMsgTypeRawData = 1;
- kMsgTypeProcQueryTopic = 6;
- kMsgTypeProcQueryTopicReply = 7;
- kMsgTypeProcRegisterTopics = 8;
- kMsgTypeProcHeartbeat = 9;
+ kMsgTypeCommonReply = 2;
+
+ kMsgTypeProcInit = 8;
+ kMsgTypeProcInitReply = 9;
+ kMsgTypeRegister= 10;
+ // kMsgTypeRegisterReply= 11;
+ kMsgTypeHeartbeat = 12;
+ // kMsgTypeHeartbeatReply = 13;
+ kMsgTypeQueryTopic = 14;
+ kMsgTypeQueryTopicReply = 15;
+ kMsgTypeRequestTopic = 16;
+ kMsgTypeRequestTopicReply = 17;
+ kMsgTypeRegisterRPC = 18;
+ // reply
+
+ kMsgTypePublish = 20;
+ // kMsgTypePublishReply = 21;
+ kMsgTypeSubscribe = 22;
+ // kMsgTypeSubscribeReply = 23;
+ kMsgTypeUnsubscribe = 24;
+ // kMsgTypeUnsubscribeReply = 25;
+ kMsgTypeUnregister = 26;
+ // kMsgTypeUnregisterReply = 27;
+ kMsgTypeQueryProc = 28;
+ kMsgTypeQueryProcReply = 29;
+
}
-message DataPub {
- bytes topic = 1;
- bytes data = 2;
+message MsgSubscribe {
+ MsgTopicList topics = 1;
+ bool network = 2;
+}
+message MsgUnsubscribe {
+ MsgTopicList topics = 1;
+ bool network = 2;
+}
+message MsgRegisterRPC {
+ MsgTopicList topics = 1;
}
-message DataSub {
- repeated bytes topics = 1;
+message MsgProcInit{
+ int32 extra_mq_num = 1;
+} // proc_id is in header.
+
+message MsgProcInitReply {
+ ErrorMsg errmsg = 1;
+ int32 proc_index = 2;
+ repeated BHAddress extra_mqs = 3;
}
-message DataRequest {
- bytes topic = 1;
- bytes data = 2;
+service TopicRPC {
+ rpc Query (MsgQueryTopic) returns (MsgQueryTopicReply);
+ rpc Request (MsgRequestTopic) returns (MsgQueryTopicReply);
}
-message DataReply {
- bytes data = 1;
+message MsgRequest {
+ // oneof body;
+ oneof request {
+ MsgRegister register = 1;
+ MsgRequestTopic topic_request = 2;
+ MsgQueryTopic topic_query = 3;
+ }
}
-message DataProcRegister
-{
- ProcInfo proc = 1;
- repeated bytes topics = 2;
+message MsgReply {
+ ErrorMsg err_msg = 1;
+ // oneof reply
}
-message DataProcHeartbeat
-{
- ProcInfo proc = 1;
+message BHMsgBody {
+ oneof reqrep {
+ MsgRequest request = 1;
+ MsgReply reply = 2;
+ }
}
-
-message DataProcQueryTopic {
- bytes topic = 1;
-}
-
-message DataProcQueryTopicReply {
- BHAddress address = 1;
-}
-
-service TopicRequestReplyService {
- rpc Request (DataRequest) returns (DataReply);
-}
\ No newline at end of file
--
Gitblit v1.8.0