From dc12826dd61ce18fac3a9561c5843d30a0cf9660 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 02 四月 2021 15:48:53 +0800
Subject: [PATCH] add request topic cache; refactor req/rep center.

---
 proto/source/bhome_msg.proto |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/proto/source/bhome_msg.proto b/proto/source/bhome_msg.proto
index 149d8ee..a8e5073 100644
--- a/proto/source/bhome_msg.proto
+++ b/proto/source/bhome_msg.proto
@@ -4,13 +4,31 @@
 
 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 BHMsg {
+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;
@@ -50,12 +68,6 @@
 	bytes data = 1; 
 }
 
-message ProcInfo
-{
-	bytes name = 1;
-	bytes info = 2;
-}
-
 message DataProcRegister
 {
 	ProcInfo proc = 1;
@@ -74,3 +86,7 @@
 message DataProcQueryTopicReply {
 	BHAddress address = 1;
 }
+
+service TopicRequestReplyService {
+	rpc Request (DataRequest) returns (DataReply);
+}
\ No newline at end of file

--
Gitblit v1.8.0