Repository: robustmq/robustmq (language: rust)

Issue:
[Docs]`register_node` under mqtt-broker-server
### Have you checked the documentation for submitting an Issue?

- [x] Yes.

### What type of enhancement is this?

Doc

### What does the enhancement do?

We need to sort out the MQTT Broker chain to help us with subsequent observability and unit test refactoring.

### Implementation challenges

No.

### Are you willing to submit PR?

- [ ] Yes. I would be willing to submit a PR with guidance from the RobustMQ community to improve.
- [x] No. I cannot submit a PR at this time.


Discussion / hints:

Fix patch:
diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml
index fb0511284..46eeb5144 100644
--- a/.github/ISSUE_TEMPLATE/enhancement.yml
+++ b/.github/ISSUE_TEMPLATE/enhancement.yml
@@ -14,7 +14,7 @@
 
 ---
 name: Enhancement
-title: "[Style/Refactor/Performance/Doc/Test/Build/CI/Chore]"
+title: "[Style/Refactor/Performance/Docs/Test/Build/CI/Chore]"
 description: Suggest an enhancement to existing functionality
 labels: [ "enhancement" ]
 body:
diff --git a/docs/.design/module/mqtt broker/GRPC.md b/docs/.design/module/mqtt broker/GRPC.md
new file mode 100644
index 000000000..cf3015b04
--- /dev/null
+++ b/docs/.design/module/mqtt broker/GRPC.md
@@ -0,0 +1,70 @@
+# GRPC模型
+client -> server
+
+四种通信模型
+1. 简单RPC 客户端单一请求 服务器单一响应
+2. 服务器流式RPC 客户端单一请求 服务端流式响应
+3. 客户端流式RPC 客户端流式请求 服务端单一响应
+4. 双向流式RPC 客户端流式请求 服务端流式请求
+
+client 发送 请求信息 給 server
+server 处理 请求信息 来自 client
+server 发送 响应信息 给 client
+client 处理 响应信息 来自 server
+
+# MQTT Broker
+
+接口名称: RegisterNode
+
+通信模式: 简单RPC
+
+Client: Mqtt Broker
+
+Server: Placement Center
+
+请求信息:
+
+```protobuf
+// The type of the cluster.
+enum ClusterType{
+    // The type of the PlacementCenter.
+    PlacementCenter = 0;
+    // The type of the JournalServer.
+    JournalServer = 1;
+    // The type of the MQTTBrokerServer.
+    MQTTBrokerServer = 2;
+    // The type of the AMQPBrokerServer.
+    AMQPBrokerServer = 3;
+}
+
+message RegisterNodeRequest{
+    ClusterType cluster_type = 1;
+    string cluster_name = 2;
+    string node_ip = 3;
+    uint64 node_id = 4;
+    string node_inner_addr = 5;
+    string extend_info = 6;
+}
+
+```
+
+
+如何处理请求
+
+1. 利用raft算法存储节点信息
+2. 如果没有查到集群信息，利用raft算法存储集群信息
+3. JournalServer情况下需要update_cache
+4. 进行首次心跳会报
+
+响应信息
+
+```protobuf
+
+message RegisterNodeReply{
+
+}
+```
+
+如何处理响应信息
+
+不重要
diff --git a/docs/images/WechatGroup.png b/docs/images/WechatGroup.png
index 9a2137603..541daae85 100644
Binary files a/docs/images/WechatGroup.png and b/docs/images/WechatGroup.png differ
diff --git a/src/journal-server/src/segment/write.rs b/src/journal-server/src/segment/write.rs
index 85f9f91df..36a54bb1f 100644
--- a/src/journal-server/src/segment/write.rs
+++ b/src/journal-server/src/segment/write.rs
@@ -234,7 +234,7 @@ async fn get_write(
     Ok(write)
 }
 
-/// create a segment write thread which is responsible for writing data to the segment file identitied by `segment_iden`
+/// create a segment write thread which is responsible for writing data to the segment file identified by `segment_iden`
 ///
 /// Return a `SegmentWrite` handle which can be used to send data to the write thread
 pub(crate) async fn create_write_thread(
diff --git a/src/mqtt-broker/src/lib.rs b/src/mqtt-broker/src/lib.rs
index 3b2945598..bb62efe7e 100644
--- a/src/mqtt-broker/src/lib.rs
+++ b/src/mqtt-broker/src/lib.rs
@@ -150,17 +150,24 @@ where
 
     pub fn start(&self, stop_send: broadcast::Sender<bool>) {
         self.register_node();
+        self.start_cluster_heartbeat_report(stop_send.clone());
+
+        self.start_push_server();
+
+        self.start_http_server();
+
         self.start_grpc_server();
+
         self.start_mqtt_server(stop_send.clone());
-        self.start_http_server();
         self.start_websocket_server(stop_send.clone());
         self.start_keep_alive_thread(stop_send.clone());
-        self.start_cluster_heartbeat_report(stop_send.clone());
+
         self.start_update_user_cache_thread(stop_send.clone());
         self.start_update_acl_cache_thread(stop_send.clone());
         self.start_update_flapping_detect_cache_thread(stop_send.clone());
-        self.start_push_server();
+
         self.start_system_topic_thread(stop_send.clone());
+
         self.awaiting_stop(stop_send);
     }
 
diff --git a/src/placement-center/src/server/grpc/service_inner.rs b/src/placement-center/src/server/grpc/service_inner.rs
index cd709bf1f..89624cf7e 100644
--- a/src/placement-center/src/server/grpc/service_inner.rs
+++ b/src/placement-center/src/server/grpc/service_inner.rs
@@ -112,7 +112,7 @@ impl PlacementCenterService for GrpcPlacementService {
             nodes.push(raw.encode())
         }
 
-        return Ok(Response::new(NodeListReply { nodes }));
+        Ok(Response::new(NodeListReply { nodes }))
     }
 
     async fn register_node(


Test patch: